Skip to content

Commit

Permalink
change removeTab to _endRemoveTab to allow onunload triggers to resol…
Browse files Browse the repository at this point in the history
…ve before closing animation
  • Loading branch information
ericawright committed Jun 2, 2016
1 parent fae84ec commit c016ad0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions verticaltabs.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ VerticalTabs.prototype = {
}.bind(this);

this.window.VerticalTabs = this;
this.removeTab = this.window.gBrowser.removeTab;
this._endRemoveTab = this.window.gBrowser._endRemoveTab;
this.inferFromText = this.window.ToolbarIconColor.inferFromText;
let AppConstants = this.AppConstants;
let window = this.window;
Expand Down Expand Up @@ -149,7 +149,7 @@ VerticalTabs.prototype = {
}.bind(this.window.ToolbarIconColor);
this.unloaders.push(function () {
this.window.ToolbarIconColor.inferFromText = this.inferFromText;
this.window.gBrowser.removeTab = this.removeTab;
this.window.gBrowser._endRemoveTab = this._endRemoveTab;
this.window.BrowserOpenTab = this.BrowserOpenTab;
delete this.window.VerticalTabs;
});
Expand Down Expand Up @@ -435,15 +435,15 @@ VerticalTabs.prototype = {
aTab.setAttribute('crop', 'end');
}

this.window.gBrowser.removeTab = (aTab) => {
this.window.gBrowser._endRemoveTab = (aTab) => {
aTab.classList.remove('tab-visible');
aTab.classList.add('tab-hidden');
aTab.addEventListener('animationend', (e) => {
if (e.animationName === 'fade-out') {
let tabStack = this.document.getAnonymousElementByAttribute(aTab, 'class', 'tab-stack');
tabStack.collapsed = true; //there is a visual jump if we do not collapse the tab before the end of the animation
} else if (e.animationName === 'slide-out') {
this.removeTab.bind(this.window.gBrowser)(aTab);
this._endRemoveTab.bind(this.window.gBrowser)(aTab);
}
});
};
Expand Down

0 comments on commit c016ad0

Please sign in to comment.