Skip to content

Commit

Permalink
Remove mouseup handler in demo/menu-promise
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Prud'hommeaux committed Sep 21, 2020
1 parent 8631fa2 commit 59fec3a
Showing 1 changed file with 1 addition and 10 deletions.
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

0 comments on commit 59fec3a

Please sign in to comment.