зеркало из https://github.com/mozilla/pjs.git
Bug 714594 - Don't list app tabs in the all tabs menu. r=mak ui-r=boriss
--HG-- extra : rebase_source : 462d500d1f44f637bb30eb7c29d0e444e221964f
This commit is contained in:
Родитель
74ccc5d9e2
Коммит
c9fbe7c6f4
|
@ -3811,49 +3811,34 @@
|
|||
<binding id="tabbrowser-alltabs-popup"
|
||||
extends="chrome://global/content/bindings/popup.xml#popup">
|
||||
<implementation implements="nsIDOMEventListener">
|
||||
<method name="_menuItemOnCommand">
|
||||
<parameter name="aEvent"/>
|
||||
<body><![CDATA[
|
||||
gBrowser.selectedTab = aEvent.target.tab;
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="_tabOnAttrModified">
|
||||
<parameter name="aEvent"/>
|
||||
<body><![CDATA[
|
||||
var tab = aEvent.target;
|
||||
this._setMenuitemAttributes(tab.mCorrespondingMenuitem, tab);
|
||||
if (tab.mCorrespondingMenuitem)
|
||||
this._setMenuitemAttributes(tab.mCorrespondingMenuitem, tab);
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="_tabOnTabClose">
|
||||
<parameter name="aEvent"/>
|
||||
<body><![CDATA[
|
||||
var menuItem = aEvent.target.mCorrespondingMenuitem;
|
||||
if (menuItem)
|
||||
this.removeChild(menuItem);
|
||||
var tab = aEvent.target;
|
||||
if (tab.mCorrespondingMenuitem)
|
||||
this.removeChild(tab.mCorrespondingMenuitem);
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="handleEvent">
|
||||
<parameter name="aEvent"/>
|
||||
<body><![CDATA[
|
||||
if (!aEvent.isTrusted)
|
||||
return;
|
||||
|
||||
switch (aEvent.type) {
|
||||
case "command":
|
||||
this._menuItemOnCommand(aEvent);
|
||||
break;
|
||||
case "TabAttrModified":
|
||||
this._tabOnAttrModified(aEvent);
|
||||
break;
|
||||
case "TabClose":
|
||||
this._tabOnTabClose(aEvent);
|
||||
break;
|
||||
case "TabOpen":
|
||||
this._createTabMenuItem(aEvent.originalTarget);
|
||||
break;
|
||||
case "scroll":
|
||||
this._updateTabsVisibilityStatus();
|
||||
break;
|
||||
|
@ -3874,8 +3859,6 @@
|
|||
if (!curTab) // "Tab Groups" menuitem and its menuseparator
|
||||
continue;
|
||||
let curTabBO = curTab.boxObject;
|
||||
if (!curTabBO) // "Tabs From Other Computers" menuitem
|
||||
continue;
|
||||
if (curTabBO.screenX >= tabstripBO.screenX &&
|
||||
curTabBO.screenX + curTabBO.width <= tabstripBO.screenX + tabstripBO.width)
|
||||
this.childNodes[i].setAttribute("tabIsVisible", "true");
|
||||
|
@ -3896,14 +3879,10 @@
|
|||
|
||||
this._setMenuitemAttributes(menuItem, aTab);
|
||||
|
||||
// Keep some attributes of the menuitem in sync with its
|
||||
// corresponding tab (e.g. the tab label)
|
||||
aTab.mCorrespondingMenuitem = menuItem;
|
||||
menuItem.tab = aTab;
|
||||
menuItem.addEventListener("command", this, false);
|
||||
|
||||
this.appendChild(menuItem);
|
||||
return menuItem;
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
|
@ -3938,18 +3917,17 @@
|
|||
<handlers>
|
||||
<handler event="popupshowing">
|
||||
<![CDATA[
|
||||
// set up the menu popup
|
||||
var tabcontainer = gBrowser.tabContainer;
|
||||
let tabs = gBrowser.visibleTabs;
|
||||
|
||||
// Listen for changes in the tab bar.
|
||||
tabcontainer.addEventListener("TabOpen", this, false);
|
||||
tabcontainer.addEventListener("TabAttrModified", this, false);
|
||||
tabcontainer.addEventListener("TabClose", this, false);
|
||||
tabcontainer.mTabstrip.addEventListener("scroll", this, false);
|
||||
|
||||
let tabs = gBrowser.visibleTabs;
|
||||
for (var i = 0; i < tabs.length; i++) {
|
||||
this._createTabMenuItem(tabs[i]);
|
||||
if (!tabs[i].pinned)
|
||||
this._createTabMenuItem(tabs[i]);
|
||||
}
|
||||
this._updateTabsVisibilityStatus();
|
||||
]]></handler>
|
||||
|
@ -3960,14 +3938,12 @@
|
|||
for (let i = this.childNodes.length - 1; i > 0; i--) {
|
||||
let menuItem = this.childNodes[i];
|
||||
if (menuItem.tab) {
|
||||
menuItem.removeEventListener("command", this, false);
|
||||
menuItem.tab.mCorrespondingMenuitem = null;
|
||||
this.removeChild(menuItem);
|
||||
}
|
||||
}
|
||||
var tabcontainer = gBrowser.tabContainer;
|
||||
tabcontainer.mTabstrip.removeEventListener("scroll", this, false);
|
||||
tabcontainer.removeEventListener("TabOpen", this, false);
|
||||
tabcontainer.removeEventListener("TabAttrModified", this, false);
|
||||
tabcontainer.removeEventListener("TabClose", this, false);
|
||||
]]></handler>
|
||||
|
@ -3988,6 +3964,11 @@
|
|||
XULBrowserWindow.setOverLink("", null);
|
||||
]]></handler>
|
||||
|
||||
<handler event="command"><![CDATA[
|
||||
if (event.target.tab)
|
||||
gBrowser.selectedTab = event.target.tab;
|
||||
]]></handler>
|
||||
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче