Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove mouseup handler in demo/menu-promise
  • Loading branch information
Eric Prud'hommeaux committed Sep 21, 2020
commit 59fec3a2d14373ca207549e490a38ac574f719f5
11 changes: 1 addition & 10 deletions documentation/demo/menu-promise.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,9 @@ currentMenu: menu-promise

// right-click handler enables mouseup handler
function rightClickHandler (e) {
e.preventDefault();
const $this = $(this)
$this.on('mouseup', mouseUpHandler);
$this.off('contextmenu', rightClickHandler)
}

// on mouseup, wait for the menu items and paint a context menu
function mouseUpHandler (e) {
e.preventDefault();
const $this = $(this);
$this.off('mouseup', mouseUpHandler);
$this.off('contextmenu', rightClickHandler);

// when the items are ready,
buildMenuItemsPromise().then(items => {
Expand All @@ -89,7 +81,6 @@ currentMenu: menu-promise

$this.on('contextmenu', rightClickHandler)
});
return false
}

// callback insert letters over the selection
Expand Down