Bug 1584076 - Hide the 'Firefox Services' label when there are no services. r=vbudhram
authorMark Hammond <mhammond@skippinet.com.au>
Tue, 01 Oct 2019 14:33:01 +0000
changeset 495880 d726e857c5507202bbf0033ef2b9162068016c81
parent 495879 cb9bbf38fa45ad65e3016495455e216f69f57ba0
child 495881 989e51b082910664e301e6b15095c1135289f951
push id114140
push userdvarga@mozilla.com
push dateWed, 02 Oct 2019 18:04:51 +0000
treeherdermozilla-inbound@32eb0ea893f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvbudhram
bugs1584076
milestone71.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 1584076 - Hide the 'Firefox Services' label when there are no services. r=vbudhram Differential Revision: https://phabricator.services.mozilla.com/D47720
browser/base/content/browser.js
browser/components/customizableui/content/panelUI.inc.xul
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -690,18 +690,20 @@ function updateFxaToolbarMenu(enable, is
     // the FxA toolbar menu as well. This is useful when the service
     // might not be available that browser.
     document.getElementById(
       "PanelUI-fxa-menu-send-button"
     ).hidden = !gFxaSendLoginUrl;
     document.getElementById(
       "PanelUI-fxa-menu-monitor-button"
     ).hidden = !gFxaMonitorLoginUrl;
-    document.getElementById("fxa-menu-service-separator").hidden =
-      !gFxaSendLoginUrl && !gFxaMonitorLoginUrl;
+    // If there are no services left, remove the label and sep.
+    let hideSvcs = !gFxaSendLoginUrl && !gFxaMonitorLoginUrl;
+    document.getElementById("fxa-menu-service-separator").hidden = hideSvcs;
+    document.getElementById("fxa-menu-service-label").hidden = hideSvcs;
 
     document.getElementById(
       "fxa-menu-device-name-label"
     ).value = gFxaDeviceName;
   } else {
     mainWindowEl.removeAttribute("fxatoolbarmenu");
   }
 }
--- a/browser/components/customizableui/content/panelUI.inc.xul
+++ b/browser/components/customizableui/content/panelUI.inc.xul
@@ -767,17 +767,18 @@
                         oncommand="gSync.doSyncFromFxaMenu(this);"
                         closemenu="none"/>
         <toolbarseparator/>
         <toolbarbutton id="PanelUI-fxa-menu-logins-button"
                         class="subviewbutton subviewbutton-iconic"
                         label="&logins.label;"
                         oncommand="LoginHelper.openPasswordManager(window, { entryPoint: 'fxamenu' })"/>
         <toolbarseparator id="fxa-menu-service-separator"/>
-        <label value="&fxa.menu.firefoxServices.label;"
+        <label id="fxa-menu-service-label"
+               value="&fxa.menu.firefoxServices.label;"
                class="subview-subheader"/>
         <toolbarbutton id="PanelUI-fxa-menu-monitor-button"
                        class="subviewbutton subviewbutton-iconic"
                        label="&monitorFullName;"
                        type="open-to-new"
                        oncommand="gSync.openMonitorFromFxaMenu(this);"/>
         <toolbarbutton id="PanelUI-fxa-menu-send-button"
                        class="subviewbutton subviewbutton-iconic"