Skip to content

Commit

Permalink
keyup event used for autocomplete rather than keydown, functions no l…
Browse files Browse the repository at this point in the history
…onger using deprecated bindWithEvent()
  • Loading branch information
pollen8 committed Sep 24, 2012
1 parent 0d0d53f commit e1f6a40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion media/com_fabrik/js/autocomplete-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions media/com_fabrik/js/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ var FbAutocomplete = new Class({
this.cache = {};
this.selected = -1;
this.mouseinsde = false;
document.addEvent('keydown', this.doWatchKeys.bindWithEvent(this));
document.addEvent('keydown', function (e) {
this.doWatchKeys(e);
}.bind(this));
this.testMenuClose = this.doTestMenuClose.bindWithEvent(this);
this.element = typeOf(document.id(element)) === "null" ? document.getElement(element) : document.id(element);
this.buildMenu();
Expand All @@ -36,8 +38,9 @@ var FbAutocomplete = new Class({
return;
}
this.getInputElement().setProperty('autocomplete', 'off');
this.doSearch = this.search.bindWithEvent(this);
this.getInputElement().addEvent('keyup', this.doSearch);
this.getInputElement().addEvent('keyup', function (e) {
this.search(e);
}.bind(this));

},

Expand Down

0 comments on commit e1f6a40

Please sign in to comment.