Bug 1217129: Part 2 - Clear open state of view widgets if view opening is prevented. r=gijs
authorKris Maglione <maglione.k@gmail.com>
Thu, 07 Jan 2016 19:26:33 -0800
changeset 280531 65913f5a537fefcbc32702a8d32c13c95f3f5dfb
parent 280530 8c646d5103344b1146a757dc21637a2e9921f6ce
child 280532 e2fcc19b6f27308451610a59b15bf919c1372c06
push id29918
push usercbook@mozilla.com
push dateWed, 20 Jan 2016 14:30:40 +0000
treeherdermozilla-central@b39b15928984 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs
bugs1217129
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1217129: Part 2 - Clear open state of view widgets if view opening is prevented. r=gijs
browser/components/customizableui/content/panelUI.js
--- a/browser/components/customizableui/content/panelUI.js
+++ b/browser/components/customizableui/content/panelUI.js
@@ -324,16 +324,17 @@ const PanelUI = {
     } else if (!aAnchor.open) {
       aAnchor.open = true;
       // Emit the ViewShowing event so that the widget definition has a chance
       // to lazily populate the subview with things.
       let evt = document.createEvent("CustomEvent");
       evt.initCustomEvent("ViewShowing", true, true, viewNode);
       viewNode.dispatchEvent(evt);
       if (evt.defaultPrevented) {
+        aAnchor.open = false;
         return;
       }
 
       let tempPanel = document.createElement("panel");
       tempPanel.setAttribute("type", "arrow");
       tempPanel.setAttribute("id", "customizationui-widget-panel");
       tempPanel.setAttribute("class", "cui-widget-panel");
       tempPanel.setAttribute("viewId", aViewId);