Skip to content

Commit 6e60882

Browse files
committed
Merge pull request #316 from andreasrosdal/master
Add check that root.$layer exists, to prevent calling hide() on an defined object.
2 parents 06a677b + 5b77a16 commit 6e60882

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/jquery.contextMenu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@
439439
var triggerAction = ((root.trigger === 'left' && button === 0) || (root.trigger === 'right' && button === 2));
440440

441441
// find the element that would've been clicked, wasn't the layer in the way
442-
if (document.elementFromPoint) {
442+
if (document.elementFromPoint && root.$layer) {
443443
root.$layer.hide();
444444
target = document.elementFromPoint(x - $win.scrollLeft(), y - $win.scrollTop());
445445
root.$layer.show();

0 commit comments

Comments
 (0)