[Browse] Fixed clicking on menu

Previously any click on the context menu would
close the context menu rather than doing the
appropriate action. This is now fixed. The menu
only closes when a click happens not on the
menu. #33.
This commit is contained in:
Sarah Hale 2015-07-02 15:34:11 -07:00
parent 2b67ae42bf
commit e3a96eff8d

View File

@ -92,7 +92,12 @@ define(
// Add the menu to the body
body.append(menu);
// Stop propagation so that clicks on the menu do not close the menu
menu.on('mousedown', function (event) {
event.stopPropagation();
});
// Dismiss the menu when body is clicked elsewhere
// ('mousedown' because 'click' breaks left-click context menus)
body.on('mousedown', dismiss);