Skip to content

Commit b78a3c2

Browse files
committed
Merge branch 'issue-523'
# Conflicts: # CHANGELOG.md
2 parents e0b1e61 + 1c96fb6 commit b78a3c2

5 files changed

+34
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Check if given selected value is a 0, if it is a zero so return it as is. Thanks @Falseee
99
* Events are never trigger when opening a contextMenu right after the other ([Issue #454](https://github.com/swisnl/jQuery-contextMenu/issues/454) thanks @kagant15
1010
* Accesskey jQuery Modal Dialog not working ([Issue #506](https://github.com/swisnl/jQuery-contextMenu/issues/506) thanks @CiTRO33
11+
* Fix submenu hover not always staying active if hovering over a submenu item. ([Issue #523](https://github.com/swisnl/jQuery-contextMenu/issues/523) thanks @tim-nz
1112

1213
### 2.4.4
1314

dist/jquery.contextMenu.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Licensed under
1212
* MIT License http://www.opensource.org/licenses/mit-license
1313
*
14-
* Date: 2017-04-03T15:28:34.533Z
14+
* Date: 2017-04-24T14:40:19.719Z
1515
*/
1616

1717
// jscs:disable
@@ -836,6 +836,7 @@
836836
return;
837837
}
838838

839+
839840
$this.trigger('contextmenu:focus');
840841
},
841842
// :hover done manually so key handling is possible
@@ -855,6 +856,14 @@
855856
return;
856857
}
857858

859+
console.log(opt)
860+
console.log(opt.$menu)
861+
862+
863+
if(opt && opt.$menu && opt.$menu.hasClass('context-menu-visible')){
864+
return;
865+
}
866+
858867
$this.trigger('contextmenu:blur');
859868
},
860869
// contextMenu item click
@@ -924,6 +933,11 @@
924933
// remember selected
925934
opt.$selected = root.$selected = $this;
926935

936+
937+
if(opt && opt.$node && opt.$node.hasClass('context-menu-submenu')){
938+
opt.$node.addClass(root.classNames.hover);
939+
}
940+
927941
// position sub-menu - do after show so dumb $.ui.position can keep up
928942
if (opt.$node) {
929943
root.positionSubmenu.call(opt.$node, opt.$menu);
@@ -1092,6 +1106,7 @@
10921106
if (typeof root === 'undefined') {
10931107
root = opt;
10941108
}
1109+
10951110
// create contextMenu
10961111
opt.$menu = $('<ul class="context-menu-list"></ul>').addClass(opt.className || '').data({
10971112
'contextMenu': opt,

dist/jquery.contextMenu.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.contextMenu.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/jquery.contextMenu.js

+15
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,7 @@
836836
return;
837837
}
838838

839+
839840
$this.trigger('contextmenu:focus');
840841
},
841842
// :hover done manually so key handling is possible
@@ -855,6 +856,14 @@
855856
return;
856857
}
857858

859+
console.log(opt)
860+
console.log(opt.$menu)
861+
862+
863+
if(opt && opt.$menu && opt.$menu.hasClass('context-menu-visible')){
864+
return;
865+
}
866+
858867
$this.trigger('contextmenu:blur');
859868
},
860869
// contextMenu item click
@@ -924,6 +933,11 @@
924933
// remember selected
925934
opt.$selected = root.$selected = $this;
926935

936+
937+
if(opt && opt.$node && opt.$node.hasClass('context-menu-submenu')){
938+
opt.$node.addClass(root.classNames.hover);
939+
}
940+
927941
// position sub-menu - do after show so dumb $.ui.position can keep up
928942
if (opt.$node) {
929943
root.positionSubmenu.call(opt.$node, opt.$menu);
@@ -1092,6 +1106,7 @@
10921106
if (typeof root === 'undefined') {
10931107
root = opt;
10941108
}
1109+
10951110
// create contextMenu
10961111
opt.$menu = $('<ul class="context-menu-list"></ul>').addClass(opt.className || '').data({
10971112
'contextMenu': opt,

0 commit comments

Comments
 (0)