Bug 1396953 - fix flexible space widget disappearing when adding to toolbar r=Gijs
authorMaya Messinger <maya.messinger@duke.edu>
Sat, 30 Sep 2017 18:42:24 -0400
changeset 383899 b5cf95178314a50d6ee2790cc55fb660708a3e02
parent 383897 972c3948109e948628c6f81f2528e50b82dae747
child 383900 44a60b3064559713cec01fcb7804a2ebb72b6a04
push id32613
push userarchaeopteryx@coole-files.de
push dateMon, 02 Oct 2017 09:02:56 +0000
treeherdermozilla-central@0a2877a3738c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1396953
milestone58.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 1396953 - fix flexible space widget disappearing when adding to toolbar r=Gijs MozReview-Commit-ID: BuYzvBX439p
browser/components/customizableui/CustomizeMode.jsm
--- a/browser/components/customizableui/CustomizeMode.jsm
+++ b/browser/components/customizableui/CustomizeMode.jsm
@@ -579,17 +579,22 @@ CustomizeMode.prototype = {
   },
 
   addToToolbar(aNode) {
     aNode = this._getCustomizableChildForNode(aNode);
     if (aNode.localName == "toolbarpaletteitem" && aNode.firstChild) {
       aNode = aNode.firstChild;
     }
 
-    CustomizableUI.addWidgetToArea(aNode.id, CustomizableUI.AREA_NAVBAR);
+    let widgetToAdd = aNode.id;
+    if (CustomizableUI.isSpecialWidget(widgetToAdd) && aNode.closest("#customization-palette")) {
+      widgetToAdd = widgetToAdd.match(/^customizableui-special-(spring|spacer|separator)/)[1];
+    }
+
+    CustomizableUI.addWidgetToArea(widgetToAdd, CustomizableUI.AREA_NAVBAR);
     if (!this._customizing) {
       CustomizableUI.dispatchToolboxEvent("customizationchange");
     }
 
     // If the user explicitly moves this item, turn off autohide.
     if (aNode.id == "downloads-button") {
       Services.prefs.setBoolPref(kDownloadAutoHidePref, false);
       if (this._customizing) {