Skip to content

Commit 2c4a7fe

Browse files
author
Pavel Kosko
committed
Add ability to close menu on touch devices
1 parent 1fd65a8 commit 2c4a7fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contextMenu.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@
510510
}
511511

512512
function removeAllContextMenus(e) {
513-
$document.find('body').off('mousedown', removeOnOutsideClickEvent);
513+
$document.find('body').off('mousedown touchstart', removeOnOutsideClickEvent);
514514
$document.off('scroll', removeOnScrollEvent);
515515
$(_clickedElement).removeClass('context');
516516
removeContextMenus();
@@ -579,7 +579,7 @@
579579
}
580580

581581
// Remove if the user clicks outside
582-
$document.find('body').on('mousedown', removeOnOutsideClickEvent);
582+
$document.find('body').on('mousedown touchstart', removeOnOutsideClickEvent);
583583
// Remove the menu when the scroll moves
584584
$document.on('scroll', removeOnScrollEvent);
585585

0 commit comments

Comments
 (0)