Bug 1217129: Part 2 - Clear open state of view widgets if view opening is prevented. r=gijs draft
authorKris Maglione <maglione.k@gmail.com>
Thu, 07 Jan 2016 19:26:33 -0800
changeset 320565 b577254c0f21aba616fda43a729b70e7ad65e797
parent 320564 72e33854df036ae07c7e77549688b21c57d7b95c
child 320566 e56ecc19505725f5c556bf87856bfb7cdecdcaea
push id9233
push usermaglione.k@gmail.com
push dateMon, 11 Jan 2016 20:43:12 +0000
reviewersgijs
bugs1217129
milestone46.0a1
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);