Skip to content
Browse files

Fix monkey menu hiding events.

Fixes #1627
  • Loading branch information...
1 parent 257e897 commit 9e05d39b339bfb37731728d62846c834b374d452 @arantius arantius committed Sep 16, 2012
Showing with 8 additions and 10 deletions.
  1. +0 −4 content/browser.js
  2. +4 −3 content/browser.xul
  3. +4 −3 content/menucommander.js
View
4 content/browser.js
@@ -329,10 +329,6 @@ function GM_showPopup(aEvent) {
var point = scriptsTopEl;
runsOnTop.forEach(
function(script) { point = appendScriptAfter(script, point); });
-
- // Delegate menu commands call.
- var menuCommandPopup = popup.getElementsByTagName('menupopup')[0];
- GM_MenuCommander.onPopupShowing(menuCommandPopup);
}
/**
View
7 content/browser.xul
@@ -78,10 +78,11 @@
<menu
accesskey="&menu.commands.accesskey;"
label="&menu.commands;"
- onpopupshowing="event.stopPropagation();"
- onpopuphiding="GM_MenuCommander.onPopupHiding(this);"
>
- <menupopup/>
+ <menupopup
+ onpopupshowing="GM_MenuCommander.onPopupShowing(event, this);"
+ onpopuphiding="GM_MenuCommander.onPopupHiding(event, this);"
+ />
</menu>
<menuseparator />
View
7 content/menucommander.js
@@ -16,12 +16,13 @@ GM_MenuCommander.createMenuItem = function(command) {
return menuItem;
};
-GM_MenuCommander.onPopupHiding = function(aMenuPopup) {
+GM_MenuCommander.onPopupHiding = function(aEvent, aMenuPopup) {
+ aEvent.stopPropagation(); // Do not bubble event up to containing popup.
GM_util.emptyEl(aMenuPopup);
}
-GM_MenuCommander.onPopupShowing = function(aMenuPopup) {
- GM_util.emptyEl(aMenuPopup);
+GM_MenuCommander.onPopupShowing = function(aEvent, aMenuPopup) {
+ aEvent.stopPropagation(); // Do not bubble event up to containing popup.
// Add menu items for commands for the active window.
var haveCommands = false;

0 comments on commit 9e05d39

Please sign in to comment.
Something went wrong with that request. Please try again.