mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 588340 - Flatten fake hierarchy in the "Move to Group" context menu. ui-r=faaborg r=mano
--HG-- extra : rebase_source : 8dc72fe2be6f329edefc825e4baacc0014fbec0d
This commit is contained in:
parent
6ed39c49bb
commit
dc63364efa
@ -653,7 +653,6 @@ HistoryMenu.prototype = {
|
||||
m = undoPopup.appendChild(document.createElement("menuitem"));
|
||||
m.id = "menu_restoreAllTabs";
|
||||
m.setAttribute("label", strings.getString("menuRestoreAllTabs.label"));
|
||||
m.setAttribute("accesskey", strings.getString("menuRestoreAllTabs.accesskey"));
|
||||
m.addEventListener("command", function() {
|
||||
for (var i = 0; i < undoItems.length; i++)
|
||||
undoCloseTab();
|
||||
@ -731,7 +730,6 @@ HistoryMenu.prototype = {
|
||||
let m = undoPopup.appendChild(document.createElement("menuitem"));
|
||||
m.id = "menu_restoreAllWindows";
|
||||
m.setAttribute("label", gNavigatorBundle.getString("menuRestoreAllWindows.label"));
|
||||
m.setAttribute("accesskey", gNavigatorBundle.getString("menuRestoreAllWindows.accesskey"));
|
||||
m.setAttribute("oncommand",
|
||||
"for (var i = 0; i < " + undoItems.length + "; i++) undoCloseWindow();");
|
||||
},
|
||||
|
@ -139,32 +139,32 @@ let TabView = {
|
||||
|
||||
// ----------
|
||||
updateContextMenu: function(tab, popup) {
|
||||
let separator = document.getElementById("context_tabViewNamedGroups");
|
||||
let isEmpty = true;
|
||||
|
||||
while(popup.lastChild && popup.lastChild.id != "context_namedGroups")
|
||||
popup.removeChild(popup.lastChild);
|
||||
while (popup.firstChild && popup.firstChild != separator)
|
||||
popup.removeChild(popup.firstChild);
|
||||
|
||||
let self = this;
|
||||
this._initFrame(function() {
|
||||
let activeGroup = tab.tabItem.parent;
|
||||
let groupItems = self._window.GroupItems.groupItems;
|
||||
|
||||
|
||||
groupItems.forEach(function(groupItem) {
|
||||
if (groupItem.getTitle().length > 0 &&
|
||||
(!activeGroup || activeGroup.id != groupItem.id)) {
|
||||
let menuItem = self._createGroupMenuItem(groupItem);
|
||||
popup.appendChild(menuItem);
|
||||
popup.insertBefore(menuItem, separator);
|
||||
isEmpty = false;
|
||||
}
|
||||
});
|
||||
document.getElementById("context_namedGroups").hidden = isEmpty;
|
||||
separator.hidden = isEmpty;
|
||||
});
|
||||
},
|
||||
|
||||
// ----------
|
||||
_createGroupMenuItem : function(groupItem) {
|
||||
let menuItem = document.createElement("menuitem")
|
||||
menuItem.setAttribute("class", "group");
|
||||
menuItem.setAttribute("label", groupItem.getTitle());
|
||||
menuItem.setAttribute(
|
||||
"oncommand",
|
||||
|
@ -128,13 +128,11 @@
|
||||
oncommand="gBrowser.unpinTab(TabContextMenu.contextTab);"/>
|
||||
<menu id="context_tabViewMenu" label="&moveToGroup.label;"
|
||||
accesskey="&moveToGroup.accesskey;">
|
||||
<menupopup id="context_tabViewMenuPopup"
|
||||
<menupopup id="context_tabViewMenuPopup"
|
||||
onpopupshowing="if (event.target == this) TabView.updateContextMenu(TabContextMenu.contextTab, this);">
|
||||
<menuitem label="&moveToNewGroup.label;"
|
||||
accesskey="&moveToNewGroup.accesskey;"
|
||||
<menuseparator id="context_tabViewNamedGroups" hidden="true"/>
|
||||
<menuitem label="&moveToNewGroup.label;"
|
||||
oncommand="TabView.moveTabTo(TabContextMenu.contextTab, null);"/>
|
||||
<menuitem id="context_namedGroups" label="&namedGroups.label;"
|
||||
disabled="true"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuseparator/>
|
||||
|
@ -27,8 +27,6 @@
|
||||
<!ENTITY moveToGroup.label "Move to Group">
|
||||
<!ENTITY moveToGroup.accesskey "M">
|
||||
<!ENTITY moveToNewGroup.label "New Group">
|
||||
<!ENTITY moveToNewGroup.accesskey "N">
|
||||
<!ENTITY namedGroups.label "Named Groups">
|
||||
<!ENTITY bookmarkThisTab.label "Bookmark This Tab">
|
||||
<!ENTITY bookmarkThisTab.accesskey "B">
|
||||
<!ENTITY bookmarkAllTabs.label "Bookmark All Tabs…">
|
||||
|
@ -142,11 +142,9 @@ menuOpenAllInTabs.label=Open All in Tabs
|
||||
|
||||
# History menu
|
||||
menuRestoreAllTabs.label=Restore All Tabs
|
||||
menuRestoreAllTabs.accesskey=R
|
||||
# LOCALIZATION NOTE (menuRestoreAllWindows, menuUndoCloseWindowLabel, menuUndoCloseWindowSingleTabLabel):
|
||||
# see bug 394759
|
||||
menuRestoreAllWindows.label=Restore All Windows
|
||||
menuRestoreAllWindows.accesskey=R
|
||||
# LOCALIZATION NOTE (menuUndoCloseWindowLabel): Semi-colon list of plural forms.
|
||||
# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
|
||||
# #1 Window Title, #2 Number of tabs
|
||||
|
@ -1529,9 +1529,3 @@ listitem.style-section {
|
||||
panel[dimmed="true"] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
/* Tab view context menu */
|
||||
|
||||
#context_tabViewMenuPopup > menuitem.group {
|
||||
-moz-padding-start: 40px;
|
||||
}
|
||||
|
@ -2117,9 +2117,3 @@ panel[dimmed="true"] {
|
||||
#sync-status-button.statusbarpanel-iconic {
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
/* Tab view context menu */
|
||||
|
||||
#context_tabViewMenuPopup > menuitem.group {
|
||||
-moz-padding-start: 40px;
|
||||
}
|
||||
|
@ -1817,9 +1817,3 @@ listitem.style-section {
|
||||
panel[dimmed="true"] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
/* Tab view context menu */
|
||||
|
||||
#context_tabViewMenuPopup > menuitem.group {
|
||||
-moz-padding-start: 40px;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user