Bug 1101669 - UITour: showInfo(search) should drop its notification from the end of the search box, not the middle. r=gijs a=dolske
authorJustin Dolske <dolske@mozilla.com>
Mon, 24 Nov 2014 13:01:44 -0800
changeset 234106 fdb3e0b2cb184db5c6948fa2404bfbbd4c052bcb
parent 234105 f74374acec82eafbcdd79adc0c36896d824e5841
child 234107 9f0a7b24c5bd5dd73f6de6a58542107829fd7d37
child 234109 dcd372476827a490186a914ce9f74fc5adf6498c
child 234111 f11fea48f8441d5737f6c4ab085429b60a1bfeb0
push id1
push usersledru@mozilla.com
push dateThu, 04 Dec 2014 17:57:20 +0000
reviewersgijs, dolske
bugs1101669
milestone35.0
Bug 1101669 - UITour: showInfo(search) should drop its notification from the end of the search box, not the middle. r=gijs a=dolske
browser/modules/UITour.jsm
--- a/browser/modules/UITour.jsm
+++ b/browser/modules/UITour.jsm
@@ -1154,19 +1154,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);
       }
     }