Back out 5bbfcd1d5296 (bug 805206) for browser-chrome failures
authorPhil Ringnalda <philringnalda@gmail.com>
Wed, 24 Oct 2012 22:35:25 -0700
changeset 111464 c723271fec16afbb94c5916eeb9be5ba085db7a2
parent 111463 8bffa268afd8f733dacc766e2e70e4ea2635740a
child 111465 081340dcc074ae3c0fa90de86b7ce84b20b80318
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
bugs805206
milestone19.0a1
backs out5bbfcd1d5296fb7524f528c8e606e8cd72cc6de9
Back out 5bbfcd1d5296 (bug 805206) for browser-chrome failures
browser/base/content/browser-social.js
--- a/browser/base/content/browser-social.js
+++ b/browser/base/content/browser-social.js
@@ -93,21 +93,16 @@ let SocialUI = {
     let brandShortName = document.getElementById("bundle_brand").getString("brandShortName");
     let label = gNavigatorBundle.getFormattedString("social.toggle.label",
                                                     [Social.provider.name,
                                                      brandShortName]);
     let accesskey = gNavigatorBundle.getString("social.toggle.accesskey");
     toggleCommand.setAttribute("label", label);
     toggleCommand.setAttribute("accesskey", accesskey);
 
-    let kbMenuitem = document.getElementById("menu_socialAmbientMenu");
-    kbMenuitem.hidden = !Social.enabled;
-    kbMenuitem.setAttribute("label", label);
-    kbMenuitem.setAttribute("accesskey", accesskey);
-
     SocialToolbar.init();
     SocialShareButton.init();
     SocialSidebar.init();
     SocialMenu.populate();
   },
 
   updateToggleCommand: function SocialUI_updateToggleCommand() {
     let toggleCommand = this.toggleCommand;
@@ -608,35 +603,35 @@ let SocialShareButton = {
 
 var SocialMenu = {
   populate: function SocialMenu_populate() {
     // This menu is only accessible through keyboard navigation.
     let submenu = document.getElementById("menu_socialAmbientMenuPopup");
     let ambientMenuItems = submenu.getElementsByClassName("ambient-menuitem");
     for (let ambientMenuItem of ambientMenuItems)
       submenu.removeChild(ambientMenuItem);
-    separator.hidden = true;
     let provider = Social.provider;
     if (Social.active && provider) {
       let iconNames = Object.keys(provider.ambientNotificationIcons);
       let separator = document.getElementById("socialAmbientMenuSeparator");
       for (let name of iconNames) {
         let icon = provider.ambientNotificationIcons[name];
         if (!icon.label || !icon.menuURL)
           continue;
-        separator.hidden = false;
         let menuitem = document.createElement("menuitem");
         menuitem.setAttribute("label", icon.label);
         menuitem.classList.add("ambient-menuitem");
         menuitem.addEventListener("command", function() {
           openUILinkIn(icon.menuURL, "tab");
         }, false);
         submenu.insertBefore(menuitem, separator);
       }
+      separator.hidden = !iconNames.length;
     }
+    document.getElementById("menu_socialAmbientMenu").hidden = !Social.enabled;
   }
 };
 
 var SocialToolbar = {
   // Called once, after window load, when the Social.provider object is initialized
   init: function SocialToolbar_init() {
     this.button.setAttribute("image", Social.provider.iconURL);
     this.updateButton();