Bug 829416 - SocialAPI ambient panel appears in middle of screen when toolbar is in Text mode. r=mixedpuppy, a=lsblakk
authorJared Wein <jwein@mozilla.com>
Wed, 16 Jan 2013 14:07:45 -0500
changeset 127206 331b0a4805860b3844ac3f6c7a6ade509931ab99
parent 127205 6766940f3ac857f436f48c11ad0c0bfc2080c3a0
child 127207 b6ae2d02d417b08d41235196f8925032e070b1e8
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmixedpuppy, lsblakk
bugs829416
milestone20.0a2
Bug 829416 - SocialAPI ambient panel appears in middle of screen when toolbar is in Text mode. r=mixedpuppy, a=lsblakk
browser/base/content/browser-social.js
--- a/browser/base/content/browser-social.js
+++ b/browser/base/content/browser-social.js
@@ -964,18 +964,21 @@ var SocialToolbar = {
           dynamicResizer.start(panel, notificationFrame);
           setTimeout(function() {
             dispatchPanelEvent("socialFrameShow");
           }, 0);
         }, true);
       }
     });
 
-    let toolbarButtonIcon = document.getAnonymousElementByAttribute(aToolbarButton, "class", "toolbarbutton-icon");
-    panel.openPopup(toolbarButtonIcon, "bottomcenter topright", 0, 0, false, false);
+    let navBar = document.getElementById("nav-bar");
+    let anchor = navBar.getAttribute("mode") == "text" ?
+                   document.getAnonymousElementByAttribute(aToolbarButton, "class", "toolbarbutton-text") :
+                   document.getAnonymousElementByAttribute(aToolbarButton, "class", "toolbarbutton-icon");
+    panel.openPopup(anchor, "bottomcenter topright", 0, 0, false, false);
   },
 
   setPanelErrorMessage: function SocialToolbar_setPanelErrorMessage(aNotificationFrame) {
     if (!aNotificationFrame)
       return;
 
     let src = aNotificationFrame.getAttribute("src");
     aNotificationFrame.removeAttribute("src");