Skip to content

Commit

Permalink
Merge pull request #8 from JustOff/tabkit2
Browse files Browse the repository at this point in the history
Preserve the Tab Kit 2 trees when unloading tabs
  • Loading branch information
JustOff authored Dec 30, 2018
2 parents f3c3efc + 741aa51 commit c8f450a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,20 @@ LullTheTabs.prototype = {
});
}

// Restore tree when using Tab Kit 2
if (this.browserWindow.tabkit && this.browserWindow.tabkit.api) {
let tk2api = this.browserWindow.tabkit.api;
let parent = tk2api.getParentTab(aTab);
if (parent) {
tk2api.addChildTabs(parent, [newtab]);
}
let children = tk2api.getChildTabs(aTab);
if (children && children.length) {
tk2api.addChildTabs(newtab, children);
}
tk2api.resetTab(aTab);
}

// If we are in the full reload mode, select the new tab.
if (aOptions && aOptions.force && aOptions.reload) {
tabbrowser.selectedTab = newtab;
Expand Down

0 comments on commit c8f450a

Please sign in to comment.