summaryrefslogtreecommitdiff
path: root/ext/js/dom/popup-menu.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/dom/popup-menu.js')
-rw-r--r--ext/js/dom/popup-menu.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/ext/js/dom/popup-menu.js b/ext/js/dom/popup-menu.js
index af076baa..d8c75869 100644
--- a/ext/js/dom/popup-menu.js
+++ b/ext/js/dom/popup-menu.js
@@ -86,17 +86,19 @@ class PopupMenu extends EventDispatcher {
_onMenuContainerClick(e) {
if (e.currentTarget !== e.target) { return; }
- e.stopPropagation();
- e.preventDefault();
- this._close(null, 'outside', true, e);
+ if (this._close(null, 'outside', true, e)) {
+ e.stopPropagation();
+ e.preventDefault();
+ }
}
_onMenuItemClick(e) {
const item = e.currentTarget;
if (item.disabled) { return; }
- e.stopPropagation();
- e.preventDefault();
- this._close(item, 'item', true, e);
+ if (this._close(item, 'item', true, e)) {
+ e.stopPropagation();
+ e.preventDefault();
+ }
}
_onWindowResize() {