2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-22 12:55:12 +00:00

Fix issue with keyPress context

This commit is contained in:
Tomas Kirda 2012-11-10 12:43:25 -06:00
parent adfae28573
commit 948ce9cdb7

View File

@ -73,11 +73,12 @@
killerFn: null,
initialize: function () {
var me, uid, autocompleteElId;
me = this;
uid = Math.floor(Math.random() * 0x100000).toString(16);
autocompleteElId = 'Autocomplete_' + uid;
var me = this,
uid = Math.floor(Math.random() * 0x100000).toString(16),
autocompleteElId = 'Autocomplete_' + uid,
onKeyPress = function (e) {
me.onKeyPress(e);
};
this.killerFn = function (e) {
if ($(e.target).parents('.autocomplete').size() === 0) {
@ -98,9 +99,9 @@
this.fixPosition();
if (window.opera) {
this.el.keypress(me.onKeyPresse);
this.el.keypress(onKeyPress);
} else {
this.el.keydown(me.onKeyPress);
this.el.keydown(onKeyPress);
}
this.el.keyup(function (e) { me.onKeyUp(e); });