[Pkg-mozext-commits] [tabmixplus] 01/44: Make tab DnD indicator visible, when user move TabsToolbar directly above content

David Prévot taffit at moszumanska.debian.org
Wed Oct 15 02:09:57 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository tabmixplus.

commit eb67e5abecfd74280806f32f7449583ad2d6147f
Author: onemen <tabmix.onemen at gmail.com>
Date:   Mon Sep 29 20:27:42 2014 +0300

    Make tab DnD indicator visible, when user move TabsToolbar directly above content
---
 chrome/content/minit/minit.js | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/chrome/content/minit/minit.js b/chrome/content/minit/minit.js
index 797ca58..9cfebe3 100644
--- a/chrome/content/minit/minit.js
+++ b/chrome/content/minit/minit.js
@@ -18,6 +18,7 @@ var TMP_tabDNDObserver = {
   TAB_DROP_TYPE: "application/x-moz-tabbrowser-tab",
   draggedTab: null,
   paddingLeft: 0,
+  onLastToolbar: false,
 
   init: function TMP_tabDNDObserver_init() {
     var tabBar = gBrowser.tabContainer;
@@ -93,6 +94,14 @@ var TMP_tabDNDObserver = {
 
     // without this the Indicator is not visible on the first drag
     tabBar._tabDropIndicator.style.MozTransform = "translate(0px, 0px)";
+
+    if (Tabmix.isVersion(280)) {
+      let t = document.getElementById("TabsToolbar").parentNode.getBoundingClientRect();
+      let r = gBrowser.tabContainer.getBoundingClientRect();
+      let c = document.getElementById("content-deck").getBoundingClientRect();
+      this.onLastToolbar = Math.abs(t.bottom - r.bottom) < 2 && Math.abs(r.bottom - c.top) < 2;
+    }
+
   },
 
   get _isCustomizing() {
@@ -656,16 +665,23 @@ var TMP_tabDNDObserver = {
 
       ///XXX fix min/max x margin when in one row the drag mark is visible after the arrow when the last tab is partly visible
       ///XXX look like the same is happen with Firefox
-      var newMarginY;
+      var newMarginY, fixMargin;
       if (TabmixTabbar.position == 1) {
         newMarginY = tabRect.bottom - ind.parentNode.getBoundingClientRect().bottom;
-        if (document.getElementById("addon-bar").collapsed)
-          ind.style.marginBottom = "0px";
-        else
-          ind.style.removeProperty("margin-bottom");
+        let addOnBar = document.getElementById("addon-bar");
+        fixMargin = newMarginY == 0 &&
+              (Tabmix.isVersion(280) || addOnBar && addOnBar.collapsed);
       }
-      else
+      else {
         newMarginY = tabRect.bottom - rect.bottom;
+        fixMargin = newMarginY == 0 && this.onLastToolbar;
+      }
+      // make indicator visible
+      if (fixMargin)
+        ind.style.marginBottom = "1px";
+      else
+        ind.style.removeProperty("margin-bottom");
+
       this.setFirefoxDropIndicator(true);
       newMargin += ind.clientWidth / 2;
       if (!ltr)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git



More information about the Pkg-mozext-commits mailing list