[Pkg-mozext-commits] [tabmixplus] 52/123: Catch tabs width in a weakMap to reduce calls to TabmixTabbar.updateScrollStatus

David Prévot taffit at moszumanska.debian.org
Wed Sep 17 21:16:26 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 9fe6512ee8bb8abd1c0dae65e76c81d5d147d729
Author: onemen <tabmix.onemen at gmail.com>
Date:   Wed Aug 27 09:41:47 2014 +0300

    Catch tabs width in a weakMap to reduce calls to TabmixTabbar.updateScrollStatus
---
 chrome/content/tabmix.js | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/chrome/content/tabmix.js b/chrome/content/tabmix.js
index dc4cf1a..b0a7243 100644
--- a/chrome/content/tabmix.js
+++ b/chrome/content/tabmix.js
@@ -621,6 +621,7 @@ var TMP_eventListener = {
     delete Tabmix.adjustTabstrip;
   },
 
+  tabWidthCache: new WeakMap(),
   onTabAttrModified: function (aEvent) {
     if (!TabmixTabbar.widthFitTitle)
       return;
@@ -628,6 +629,12 @@ var TMP_eventListener = {
     // catch tab width changed when label attribute changed
     // or when busy attribute changed hide/show image
     var tab = aEvent.target;
+    var width = tab.boxObject.width;
+    if (this.tabWidthCache.has(tab) && this.tabWidthCache.get(tab) == width)
+      return;
+
+    this.tabWidthCache.set(tab, width);
+
     TabmixTabbar.updateScrollStatus();
     setTimeout(function(){TabmixTabbar.updateScrollStatus();}, 2500);
   },

-- 
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