diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 23d5cb27d..a583a489f 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -6945,8 +6945,7 @@ this.insertEntry(entry, menu, data); } $.addClass(lastToggledButton, 'active'); - $.on(d, 'click', this.close); - $.on(d, 'CloseMenu', this.close); + $.one(d, 'click scroll CloseMenu', this.close); Rice.nodes(menu); $.add(Header.hover, menu); mRect = menu.getBoundingClientRect(); @@ -6999,8 +6998,7 @@ $.rm(currentMenu); $.rmClass(lastToggledButton, 'active'); currentMenu = null; - lastToggledButton = null; - return $.off(d, 'click CloseMenu', this.close); + return lastToggledButton = null; }; Menu.prototype.findNextEntry = function(entry, direction) { diff --git a/builds/crx/script.js b/builds/crx/script.js index cef19ff89..6747a3f90 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -6970,8 +6970,7 @@ this.insertEntry(entry, menu, data); } $.addClass(lastToggledButton, 'active'); - $.on(d, 'click', this.close); - $.on(d, 'CloseMenu', this.close); + $.one(d, 'click scroll CloseMenu', this.close); Rice.nodes(menu); $.add(Header.hover, menu); mRect = menu.getBoundingClientRect(); @@ -7024,8 +7023,7 @@ $.rm(currentMenu); $.rmClass(lastToggledButton, 'active'); currentMenu = null; - lastToggledButton = null; - return $.off(d, 'click CloseMenu', this.close); + return lastToggledButton = null; }; Menu.prototype.findNextEntry = function(entry, direction) { diff --git a/src/General/UI.coffee b/src/General/UI.coffee index 2ae26fba2..7d07d87dc 100755 --- a/src/General/UI.coffee +++ b/src/General/UI.coffee @@ -60,8 +60,7 @@ UI = do -> $.addClass lastToggledButton, 'active' - $.on d, 'click', @close - $.on d, 'CloseMenu', @close + $.one d, 'click scroll CloseMenu', @close Rice.nodes menu $.add Header.hover, menu @@ -117,7 +116,6 @@ UI = do -> $.rmClass lastToggledButton, 'active' currentMenu = null lastToggledButton = null - $.off d, 'click CloseMenu', @close findNextEntry: (entry, direction) -> entries = [entry.parentNode.children...]