Skip to content

Commit

Permalink
fixes swisnl#693
Browse files Browse the repository at this point in the history
  • Loading branch information
klues committed Aug 22, 2019
1 parent 17701d8 commit 2f38823
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/jquery.contextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
$currentTrigger = null,
// is contextMenu initialized with at least one menu?
initialized = false,
justOpenedSub = false,
// window handle
$win = $(window),
// number of registered menus
Expand Down Expand Up @@ -279,7 +280,7 @@
// contextmenu show dispatcher
contextmenu: function (e) {
var $this = $(this);

//Show browser context-menu when preShow returns false
if (e.data.events.preShow($this,e) === false) {
return;
Expand Down Expand Up @@ -870,6 +871,10 @@
},
// contextMenu item click
itemClick: function (e) {
if (justOpenedSub) {
return;
}

var $this = $(this),
data = $this.data(),
opt = data.contextMenu,
Expand Down Expand Up @@ -924,6 +929,13 @@
return;
}

if (!$this.hasClass(root.classNames.visible) && $this.find('.context-menu-list').length !== 0) {
justOpenedSub = true;
setTimeout(function () {
justOpenedSub = false;
}, 100);
}

$this
.addClass([root.classNames.hover, root.classNames.visible].join(' '))
// select other items and included items
Expand Down

0 comments on commit 2f38823

Please sign in to comment.