From d88a1e9368ebc691463c7239c1fa75a99630cd32 Mon Sep 17 00:00:00 2001 From: Rodrigo Silveira Date: Tue, 26 Mar 2013 18:45:11 -0700 Subject: [PATCH] Bug 846422 - Hide context menus when popups appear [r=mbrubeck] --- browser/metro/base/content/helperui/MenuUI.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/browser/metro/base/content/helperui/MenuUI.js b/browser/metro/base/content/helperui/MenuUI.js index 90e77f433932..a32437b651e4 100644 --- a/browser/metro/base/content/helperui/MenuUI.js +++ b/browser/metro/base/content/helperui/MenuUI.js @@ -343,6 +343,7 @@ MenuPopup.prototype = { window.addEventListener("keypress", this, true); window.addEventListener("mousedown", this, true); + Elements.stack.addEventListener("PopupChanged", this, false); this._panel.hidden = false; this._position(aPositionOptions || {}); @@ -372,6 +373,7 @@ MenuPopup.prototype = { window.removeEventListener("keypress", this, true); window.removeEventListener("mousedown", this, true); + Elements.stack.removeEventListener("PopupChanged", this, false); let self = this; this._panel.addEventListener("transitionend", function () { @@ -494,6 +496,11 @@ MenuPopup.prototype = { this.hide(); } break; + case "PopupChanged": + if (aEvent.detail) { + this.hide(); + } + break; } } };