[Pkg-mozext-commits] [tabmixplus] 107/123: Add listener to changes in CustomizableUI for cases user or extensions changed the UI without entering customize mode

David Prévot taffit at moszumanska.debian.org
Wed Sep 17 21:16:32 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 cc1606f7e0538aa6a2c40841849b37e57f2ccc3e
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sun Sep 14 18:42:20 2014 +0300

    Add listener to changes in CustomizableUI for cases user or extensions changed the UI without entering customize mode
---
 chrome/content/minit/minit.js | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/chrome/content/minit/minit.js b/chrome/content/minit/minit.js
index a41133c..d575936 100644
--- a/chrome/content/minit/minit.js
+++ b/chrome/content/minit/minit.js
@@ -932,11 +932,33 @@ Tabmix.navToolbox = {
   customizeStarted: false,
   toolboxChanged: false,
   resetUI: false,
+  listener: null,
 
   init: function TMP_navToolbox_init() {
     this.updateToolboxItems();
     gNavToolbox.addEventListener("beforecustomization", this, false);
     gNavToolbox.addEventListener("aftercustomization", this, false);
+
+    if (!Tabmix.isVersion(290))
+      return;
+
+    this.listener = {
+      onWidgetAfterDOMChange: function(aNode, aNextNode, aContainer, aWasRemoval) {
+        if (this.customizeStarted)
+          return;
+        if (aContainer.id == "TabsToolbar") {
+          this.tabStripAreaChanged();
+          TabmixTabbar.updateScrollStatus();
+          TabmixTabbar.updateBeforeAndAfter();
+        }
+        if (!aWasRemoval) {
+          let command = aNode.getAttribute("command");
+          if (/Browser:ReloadOrDuplicate|Browser:Stop/.test(command))
+            gTMPprefObserver.showReloadEveryOnReloadButton();
+        }
+      }.bind(this)
+    }
+    CustomizableUI.addListener(this.listener);
   },
 
   deinit: function TMP_navToolbox_deinit() {
@@ -960,6 +982,8 @@ Tabmix.navToolbox = {
       }
     }
     CustomizableUI.removeWidgetFromArea("tabmixScrollBox");
+    if (Tabmix.isVersion(290))
+      CustomizableUI.removeListener(this.listener);
   },
 
   cleanCurrentset: function() {
@@ -1267,7 +1291,12 @@ Tabmix.navToolbox = {
     }
   },
 
+  _closeButtonInitialized: false,
   setCloseButtonPosition: function() {
+   if (this._closeButtonInitialized)
+      return;
+    this._closeButtonInitialized = true;
+
     if (!Tabmix.isVersion(310))
       return;
     // if tabmix-tabs-closebutton was positioned immediately after

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