Skip to content

Commit

Permalink
Fixed autocomplete JS to close the menu with jQuery().hide(), as some
Browse files Browse the repository at this point in the history
templates with webkit seem to need it, and it works on normal tmeplates
as well.
  • Loading branch information
cheesegrits committed Jan 8, 2016
1 parent 96c48cf commit 2c24368
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion media/com_fabrik/js/autocomplete-bootstrap-min.js

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

12 changes: 5 additions & 7 deletions media/com_fabrik/js/autocomplete-bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,10 @@ var FbAutocomplete = new Class({
closeMenu: function () {
if (this.shown) {
this.shown = false;
this.menu.hide();
// some templates seem to need a jQuery hide, something to do with webkit
jQuery(this.menu).hide();
this.selected = -1;
document.removeEvent('click', function (e) {
this.doTestMenuClose(e);
}.bind(this));
document.removeEvent('click', this.doCloseEvent);
}
},

Expand All @@ -265,9 +264,8 @@ var FbAutocomplete = new Class({
if (this.isMinTriggerlength()) {
this.menu.show();
this.shown = true;
document.addEvent('click', function (e) {
this.doTestMenuClose(e);
}.bind(this));
this.doCloseEvent = this.doTestMenuClose.bind(this);
document.addEvent('click', this.doCloseEvent);
this.selected = 0;
this.highlight();
}
Expand Down

0 comments on commit 2c24368

Please sign in to comment.