зеркало из https://github.com/mozilla/pjs.git
fix for bug #344587: dispatch tab open/close events in the correct order.
thanks to simon <zeniko@gmail.com> for the fix. r=sspitzer,mano sr=mconnor
This commit is contained in:
Родитель
ad00085e72
Коммит
f95b2496af
|
@ -1341,16 +1341,8 @@
|
||||||
}
|
}
|
||||||
setTimeout(_delayedUpdate, 0, this.mTabContainer);
|
setTimeout(_delayedUpdate, 0, this.mTabContainer);
|
||||||
|
|
||||||
// We're committed to closing the tab now.
|
|
||||||
// Dispatch a notification.
|
|
||||||
// We dispatch it before any teardown so that event listeners can
|
|
||||||
// inspect the tab that's about to close.
|
|
||||||
var evt = document.createEvent("Events");
|
|
||||||
evt.initEvent("TabClose", true, false);
|
|
||||||
aTab.dispatchEvent(evt);
|
|
||||||
|
|
||||||
if (l == 1) {
|
if (l == 1) {
|
||||||
// add a new blank tab to replace the one being closed
|
// add a new blank tab to replace the one we're about to close
|
||||||
// (this ensures that the remaining tab is as good as new)
|
// (this ensures that the remaining tab is as good as new)
|
||||||
this.addTab("about:blank");
|
this.addTab("about:blank");
|
||||||
l++;
|
l++;
|
||||||
|
@ -1362,6 +1354,14 @@
|
||||||
this.setStripVisibilityTo(false);
|
this.setStripVisibilityTo(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We're committed to closing the tab now.
|
||||||
|
// Dispatch a notification.
|
||||||
|
// We dispatch it before any teardown so that event listeners can
|
||||||
|
// inspect the tab that's about to close.
|
||||||
|
var evt = document.createEvent("Events");
|
||||||
|
evt.initEvent("TabClose", true, false);
|
||||||
|
aTab.dispatchEvent(evt);
|
||||||
|
|
||||||
var index = -1;
|
var index = -1;
|
||||||
if (this.mCurrentTab == aTab)
|
if (this.mCurrentTab == aTab)
|
||||||
index = this.mTabContainer.selectedIndex;
|
index = this.mTabContainer.selectedIndex;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче