Bug 979232 - adjust Australis' bookmarks animation for rtl, r=dao, a=sylvestre
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 04 Mar 2014 09:18:25 -0500
changeset 183152 bdaacace923275cf4e9e293ae8a34a7e673f0dbb
parent 183151 4468cc07a26dcecce53897ff565a17f138b02087
child 183153 c48879d0c178e97ac87101ebc43d5ef061de8620
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, sylvestre
bugs979232
milestone29.0a2
Bug 979232 - adjust Australis' bookmarks animation for rtl, r=dao, a=sylvestre
browser/base/content/browser-places.js
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -1322,25 +1322,30 @@ let BookmarkingUI = {
 
   _showBookmarkedNotification: function BUI_showBookmarkedNotification() {
 
     if (this._notificationTimeout) {
       clearTimeout(this._notificationTimeout);
     }
 
     if (this.notifier.style.transform == '') {
+      let isRTL = getComputedStyle(this.button).direction == "rtl";
       let buttonRect = this.button.getBoundingClientRect();
       let notifierRect = this.notifier.getBoundingClientRect();
       let topDiff = buttonRect.top - notifierRect.top;
       let leftDiff = buttonRect.left - notifierRect.left;
       let heightDiff = buttonRect.height - notifierRect.height;
       let widthDiff = buttonRect.width - notifierRect.width;
       let translateX = (leftDiff + .5 * widthDiff) + "px";
       let translateY = (topDiff + .5 * heightDiff) + "px";
-      this.notifier.style.transform = "translate(" +  translateX + ", " + translateY + ")";
+      let transform = "translate(" +  translateX + ", " + translateY + ")";
+      if (isRTL) {
+        transform += " scaleX(-1)";
+      }
+      this.notifier.style.transform = transform;
     }
 
     let isInBookmarksToolbar = this.button.classList.contains("bookmark-item");
     if (isInBookmarksToolbar)
       this.notifier.setAttribute("in-bookmarks-toolbar", true);
 
     let isInOverflowPanel = this.button.classList.contains("overflowedItem");
     if (!isInOverflowPanel) {