Skip to content

Commit

Permalink
Add ability to close menu on touch devices
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Kosko committed May 30, 2018
1 parent 1fd65a8 commit 2c4a7fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@
}

function removeAllContextMenus(e) {
$document.find('body').off('mousedown', removeOnOutsideClickEvent);
$document.find('body').off('mousedown touchstart', removeOnOutsideClickEvent);
$document.off('scroll', removeOnScrollEvent);
$(_clickedElement).removeClass('context');
removeContextMenus();
Expand Down Expand Up @@ -579,7 +579,7 @@
}

// Remove if the user clicks outside
$document.find('body').on('mousedown', removeOnOutsideClickEvent);
$document.find('body').on('mousedown touchstart', removeOnOutsideClickEvent);
// Remove the menu when the scroll moves
$document.on('scroll', removeOnScrollEvent);

Expand Down

0 comments on commit 2c4a7fe

Please sign in to comment.