зеркало из https://github.com/mozilla/pjs.git
Bug 585855 - Test that the bookmark all tabs command is disabled when we have one visible and one hidden tab [r=dão sr=vlad a=gavin]
--HG-- extra : rebase_source : 728aa27e7ffdf08359c26fe709cac925c0d0f344
This commit is contained in:
Родитель
bc1421a901
Коммит
8482e84e84
|
@ -6769,8 +6769,8 @@ var gBookmarkAllTabsHandler = {
|
|||
this._command = document.getElementById("Browser:BookmarkAllTabs");
|
||||
gBrowser.tabContainer.addEventListener("TabOpen", this, true);
|
||||
gBrowser.tabContainer.addEventListener("TabClose", this, true);
|
||||
gBrowser.tabContainer.addEventListener("TabSelect", this, true);
|
||||
gBrowser.tabContainer.addEventListener("TabMove", this, true);
|
||||
gBrowser.tabContainer.addEventListener("TabShow", this, true);
|
||||
gBrowser.tabContainer.addEventListener("TabHide", this, true);
|
||||
this._updateCommandState();
|
||||
},
|
||||
|
||||
|
|
|
@ -769,7 +769,7 @@
|
|||
newBrowser.docShell.isActive = true;
|
||||
this.mCurrentBrowser = newBrowser;
|
||||
this.mCurrentTab = this.selectedTab;
|
||||
this.mCurrentTab.hidden = false;
|
||||
this.showTab(this.mCurrentTab);
|
||||
|
||||
if (updatePageReport)
|
||||
this.mCurrentBrowser.updatePageReport();
|
||||
|
@ -1791,8 +1791,39 @@
|
|||
<body>
|
||||
<![CDATA[
|
||||
Array.forEach(this.tabs, function(tab) {
|
||||
tab.hidden = aTabs.indexOf(tab) == -1 && !tab.pinned && !tab.selected;
|
||||
});
|
||||
if (aTabs.indexOf(tab) == -1)
|
||||
this.hideTab(tab);
|
||||
else
|
||||
this.showTab(tab);
|
||||
}, this);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="showTab">
|
||||
<parameter name="aTab"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (aTab.hidden) {
|
||||
aTab.hidden = false;
|
||||
let event = document.createEvent("Events");
|
||||
event.initEvent("TabShow", true, false);
|
||||
aTab.dispatchEvent(event);
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="hideTab">
|
||||
<parameter name="aTab"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (!aTab.hidden && !aTab.pinned && !aTab.selected) {
|
||||
aTab.hidden = true;
|
||||
let event = document.createEvent("Events");
|
||||
event.initEvent("TabHide", true, false);
|
||||
aTab.dispatchEvent(event);
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
|
|
@ -125,7 +125,7 @@ var UIManager = {
|
|||
|
||||
iQ(window).bind("beforeunload", function() {
|
||||
Array.forEach(gBrowser.tabs, function(tab) {
|
||||
tab.hidden = false;
|
||||
gBrowser.showTab(tab);
|
||||
});
|
||||
});
|
||||
iQ(window).bind("unload", function() {
|
||||
|
|
|
@ -171,6 +171,7 @@ _BROWSER_FILES = \
|
|||
browser_visibleTabs.js \
|
||||
browser_visibleTabs_contextMenu.js \
|
||||
browser_visibleTabs_bookmarkAllPages.js \
|
||||
browser_visibleTabs_bookmarkAllTabs.js \
|
||||
browser_visibleTabs_tabPreview.js \
|
||||
discovery.html \
|
||||
moz.png \
|
||||
|
|
|
@ -58,7 +58,7 @@ function test() {
|
|||
gBrowser.removeTab(tabOne);
|
||||
gBrowser.removeTab(tabTwo);
|
||||
Array.forEach(gBrowser.tabs, function(tab) {
|
||||
tab.hidden = false;
|
||||
gBrowser.showTab(tab);
|
||||
});
|
||||
|
||||
finish();
|
||||
|
|
Загрузка…
Ссылка в новой задаче