[Pkg-mozext-commits] [tabmixplus] 70/107: Replace eval of FullScreen.showNavToolbox (former FullScreen_mouseoverToggle) with wrapped function to prevent incompatibility with TreeStyleTab extension

David Prévot taffit at moszumanska.debian.org
Tue Dec 29 19:02:52 UTC 2015


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

taffit pushed a commit to branch master
in repository tabmixplus.

commit d0a9feb89cc8027e525fd2de73cb17dc030e9736
Author: onemen <tabmix.onemen at gmail.com>
Date:   Wed Nov 11 23:00:42 2015 +0200

    Replace eval of FullScreen.showNavToolbox (former FullScreen_mouseoverToggle) with wrapped function to prevent incompatibility with TreeStyleTab extension
---
 chrome/content/minit/tablib.js | 39 ++++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index f81b40f..4ec9825 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -526,26 +526,27 @@ var tablib = { // eslint-disable-line
     // FullScreen code related to tabs bellow content initialize by first
     // fullScreen event, see TMP_eventListener.onFullScreen
     if (Tabmix.isVersion(400)) {
-      Tabmix.changeCode(FullScreen, "FullScreen.showNavToolbox")._replace(
-        'if (!this._isChromeCollapsed) {',
-        '$&\n      ' +
-        'TMP_eventListener.showNavToolbox();'
-      )._replace(
-        /(\})(\)?)$/,
-        '  TMP_eventListener.showNavToolbox();\n' +
-        '$1$2'
-      ).toCode();
+      Tabmix.originalFunctions.FullScreen_showNavToolbox = FullScreen.showNavToolbox;
+      FullScreen.showNavToolbox = function() {
+        let result = Tabmix.originalFunctions.FullScreen_showNavToolbox.apply(this, arguments);
+        TMP_eventListener.showNavToolbox();
+        return result;
+      };
+    } else {
+      Tabmix.originalFunctions.FullScreen_mouseoverToggle = FullScreen.mouseoverToggle;
+      FullScreen.mouseoverToggle = function() {
+        let collapsed = this._isChromeCollapsed;
+        let result = Tabmix.originalFunctions.FullScreen_mouseoverToggle.apply(this, arguments);
+        if (collapsed !== this._isChromeCollapsed) {
+          if (!this._isChromeCollapsed)
+            TMP_eventListener.updateMultiRow();
+          if (TabmixTabbar.position == 1) {
+            TMP_eventListener.toggleTabbarVisibility(!this._isChromeCollapsed);
+          }
+        }
+        return result;
+      };
     }
-    else
-    Tabmix.changeCode(FullScreen, "FullScreen.mouseoverToggle")._replace(
-      'this._isChromeCollapsed = !aShow;',
-      '  $&' +
-      '  if (aShow)' +
-      '    TMP_eventListener.updateMultiRow();' +
-      '  if (TabmixTabbar.position == 1) {' +
-      '    TMP_eventListener.toggleTabbarVisibility(aShow);' +
-      '  }'
-    ).toCode();
 
     Tabmix.changeCode(window, "handleDroppedLink")._replace(
       'loadURI(uri, null, postData.value, false);',

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