[Pkg-mozext-commits] [tabmixplus] 13/44: When saved session have group data hide all tabs that are not in the active group

David Prévot taffit at moszumanska.debian.org
Wed Oct 15 02:09:59 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 3022f6a2ba4f621912fdeae21c78fdcae385063a
Author: onemen <tabmix.onemen at gmail.com>
Date:   Thu Oct 2 22:51:50 2014 +0300

    When saved session have group data hide all tabs that are not in the active group
---
 chrome/content/minit/tabView.js   | 10 +++++++++-
 chrome/content/session/session.js |  6 ++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/chrome/content/minit/tabView.js b/chrome/content/minit/tabView.js
index 764b185..2ff650b 100644
--- a/chrome/content/minit/tabView.js
+++ b/chrome/content/minit/tabView.js
@@ -270,7 +270,7 @@
       this.removeAttribute(this.gThisWin, id);
   }
 
-  TabmixSessionManager._setTabviewTab = function SM__setTabviewTab(aTab, tabdata){
+  TabmixSessionManager._setTabviewTab = function SM__setTabviewTab(aTab, tabdata, activeGroupId){
     if (tabdata.pinned)
       return;
 
@@ -323,6 +323,14 @@
       if (!tabdata.extData)
         tabdata.extData = {};
       tabdata.extData["tabview-tab"] = tabviewData;
+      // we did not saved hidden attribute when we use TGM
+      // hide all tabs that are not in the active group
+      if (!Tabmix.extensions.tabGroupManager && activeGroupId != null) {
+        if (!parsedData)
+          parsedData = TabmixSvc.JSON.parse(tabviewData);
+        if (parsedData.groupID != activeGroupId)
+          tabdata.hidden = true;
+      }
     }
     else if (tabdata.extData)
       delete tabdata.extData["tabview-tab"];
diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index 5fcc931..450cf04 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -3230,6 +3230,8 @@ try{
       this.setStripVisibility(newtabsCount);
 
       let tabsData = TabmixConvertSession.getTabsState(rdfNodeTabs, true);
+      let groups = this._tabviewData["tabview-groups"];
+      let activeGroupId = groups ? groups.activeGroupId : null;
       let tabs = [], numVisibleTabs = 0, firstVisibleTab = -1
       let needToReload = this.prefBranch.getBoolPref("restore.reloadall");
       for (let t = 0; t < tabsData.length ; t++) {
@@ -3242,6 +3244,8 @@ try{
         if (data.pinned)
           gBrowser.pinTab(tab);
 
+        this._setTabviewTab(tab, data, activeGroupId);
+
         if (data.hidden)
           gBrowser.hideTab(tab);
         else {
@@ -3251,8 +3255,6 @@ try{
             firstVisibleTab = newIndex + t;
         }
 
-        this._setTabviewTab(tab, data);
-
         if (needToReload) {
           let url = TMP_SessionStore.getActiveEntryData(data).url || "";
           if (url.indexOf("file:") != 0)

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