[Pkg-mozext-commits] [tabmixplus] 59/107: Selecting a tab before moving it to a different position can unnecessarily scroll the tabbar (selecting a tab trigger ensureElementIsVisible)

David Prévot taffit at moszumanska.debian.org
Tue Dec 29 19:02:50 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 146fc1a996fecc8e5588fa52ef8a6e6792cf88fb
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sun Nov 8 21:13:00 2015 +0200

    Selecting a tab before moving it to a different position can unnecessarily scroll the tabbar (selecting a tab trigger ensureElementIsVisible)
---
 chrome/content/minit/tablib.js          | 6 +++---
 modules/extensions/TabGroupsManager.jsm | 9 +++++----
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index 6fdd079..f81b40f 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -574,15 +574,15 @@ var tablib = { // eslint-disable-line
       '    let selectNewTab = where == "tab" ?\n' +
       '        !Tabmix.prefs.getBoolPref("loadDuplicateInBackground") :\n' +
       '        Tabmix.prefs.getBoolPref("loadDuplicateInBackground");\n' +
-      '    if (selectNewTab) {\n' +
-      '      gBrowser.selectedTab = newTab;\n' +
-      '    }\n' +
       '    let pref = Tabmix.isCallerInList("gotoHistoryIndex", "BrowserForward", "BrowserBack") ?\n' +
       '               "openTabNext" : "openDuplicateNext";\n' +
       '    if (Tabmix.prefs.getBoolPref(pref)) {\n' +
       '      let pos = newTab._tPos > aTab._tPos ? 1 : 0;\n' +
       '      gBrowser.moveTabTo(newTab, aTab._tPos + pos);\n' +
       '    }\n' +
+      '    if (selectNewTab) {\n' +
+      '      gBrowser.selectedTab = newTab;\n' +
+      '    }\n' +
       '  }\n' +
       '$1$2'
     ).toCode();
diff --git a/modules/extensions/TabGroupsManager.jsm b/modules/extensions/TabGroupsManager.jsm
index 90ae53d..ebea914 100644
--- a/modules/extensions/TabGroupsManager.jsm
+++ b/modules/extensions/TabGroupsManager.jsm
@@ -92,11 +92,12 @@ this.TMP_TabGroupsManager = {
       // open new group and add new tabs to it
       'else if (newtabsCount > 0 && !overwrite) {',
       '$&' +
-      '  gBrowser.selectedTab = TMP_addTab();' +
-      '  gBrowser.moveTabTo(gBrowser.selectedTab, gBrowser.tabs.length - 1);' +
-      '  newIndex = gBrowser.selectedTab._tPos;' +
+      '  let newTab = TMP_addTab();' +
+      '  gBrowser.moveTabTo(newTab, gBrowser.tabs.length - 1);' +
+      '  gBrowser.selectedTab = newTab;' +
+      '  newIndex = newTab._tPos;' +
       '  let group = TabGroupsManager.allGroups.openNewGroupActive(' +
-      '        gBrowser.selectedTab, -1);' +
+      '        newTab, -1);' +
       '  for (let i = 1; i < newtabsCount; i++) {' +
       '    TMP_addTab();' +
       '  }' +

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