Bug 1101669 - UITour: showInfo(search) should drop its notification from the end of the search box, not the middle. r=gijs
authorJustin Dolske <dolske@mozilla.com>
Mon, 24 Nov 2014 13:01:44 -0800
changeset 217926 837b0643d0d6abab20e12eb13bc199fcadd98bed
parent 217925 31c69e3f618167aad9c96b4c10ea960a923c0eca
child 217927 898046f0bd99d062bccca7a0a12bff9e6360bcbd
push id10200
push userfelipc@gmail.com
push dateFri, 28 Nov 2014 02:36:19 +0000
treeherderfx-team@837b0643d0d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs
bugs1101669
milestone36.0a1
Bug 1101669 - UITour: showInfo(search) should drop its notification from the end of the search box, not the middle. r=gijs
browser/modules/UITour.jsm
--- a/browser/modules/UITour.jsm
+++ b/browser/modules/UITour.jsm
@@ -1136,19 +1136,24 @@ this.UITour = {
         tooltipClose.removeEventListener("command", closeButtonCallback);
         if (aOptions.targetCallbackID && aAnchor.removeTargetListener) {
           aAnchor.removeTargetListener(document, targetCallback);
         }
       });
 
       tooltip.setAttribute("targetName", aAnchor.targetName);
       tooltip.hidden = false;
+      let xOffset = 0, yOffset = 0;
       let alignment = "bottomcenter topright";
+      if (aAnchor.targetName == "search") {
+        alignment = "after_start";
+        xOffset = 18;
+      }
       this._addAnnotationPanelMutationObserver(tooltip);
-      tooltip.openPopup(aAnchorEl, alignment);
+      tooltip.openPopup(aAnchorEl, alignment, xOffset, yOffset);
       if (tooltip.state == "closed") {
         document.defaultView.addEventListener("endmodalstate", function endModalStateHandler() {
           document.defaultView.removeEventListener("endmodalstate", endModalStateHandler);
           tooltip.openPopup(aAnchorEl, alignment);
         }, false);
       }
     }