Skip to content

Commit

Permalink
Fix error hide menu when click to input
Browse files Browse the repository at this point in the history
This bug hide menu when click to autocomplete of field input
  • Loading branch information
qtoantin5 committed Apr 23, 2015
1 parent e9885f7 commit d8795aa
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions source/plg_system_t3/base-bs3/js/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
$target.data('hide-processed', true);
setTimeout(function(){$target.data('hide-processed', false);}, 10);

self.hide(item);
self.hide(item, $target);
});

//if has child, don't goto link before open child - fix for touch screen
Expand Down Expand Up @@ -177,7 +177,7 @@
item.ctimer = setTimeout($.proxy(this.clickable, this, item), 300);
},

hide: function (item) {
hide: function (item, $target) {
clearTimeout(this.timer); //hide alls
clearTimeout(item.timer); //hide this item
clearTimeout(item.astimer); //animate timer
Expand All @@ -190,7 +190,11 @@
item.atimer = setTimeout(function(){item.$item.removeClass('animating')}, this.options.duration);
item.timer = setTimeout(function(){item.$item.removeClass('open')}, 100);
} else {
item.$item.removeClass('open');
item.timer = setTimeout(function(){
if (!$target || !$target.is('input', item.$item)) {
item.$item.removeClass('open');
}
}, 100);
}

item.status = 'close';
Expand Down

0 comments on commit d8795aa

Please sign in to comment.