Skip to content

Commit

Permalink
don't show inactive submenus
Browse files Browse the repository at this point in the history
  • Loading branch information
johndoh committed Sep 6, 2014
1 parent b36d72b commit 9963e2e
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions contextmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,16 +416,30 @@ function rcube_context_menu(p) {
a.data('command', RegExp.$1);
a.append($('<span>').addClass('right-arrow'));
row.addClass('submenu');
a.click(function(e) { ref.submenu(a, e); return false; });
a.click(function(e) {
if (!$(this).hasClass('active'))
return;

ref.submenu(a, e);
return false;
});

if (ref.mouseover_timeout > -1) {
a.mouseover(function(e) {
if (!$(this).hasClass('active'))
return;

ref.timers['submenu_show'] = window.setTimeout(function() {
ref.submenu(a, e);
}, ref.mouseover_timeout);
});

a.mouseout(function(e) { $(this).blur(); clearTimeout(ref.timers['submenu_show']); });
a.mouseout(function(e) {
if (!$(this).hasClass('active'))
return;

$(this).blur(); clearTimeout(ref.timers['submenu_show']);
});
}
}
else {
Expand Down

0 comments on commit 9963e2e

Please sign in to comment.