Fixed a typo for Bug 576408 - Implement the downgraded tab triage experience

This commit is contained in:
Raymond Lee 2010-08-07 03:52:14 +08:00
parent c3c6e69bb9
commit fdcae00d85
4 changed files with 11 additions and 24 deletions

View File

@ -58,12 +58,11 @@ let TabView = {
},
updateContextMenu: function(tab, popup) {
while(popup.lastChild && popup.lastChild.id != "context_namedGroup") {
while(popup.lastChild && popup.lastChild.id != "context_namedGroups")
popup.removeChild(popup.lastChild);
}
let tabViewWindow = document.getElementById("tab-view").contentWindow;
let showEmpty = true;
let isEmpty = true;
if (tabViewWindow) {
let activeGroup = tab.tabItem.parent;
@ -75,30 +74,20 @@ let TabView = {
(!activeGroup || activeGroup.id != group.id)) {
let menuItem = self._createGroupMenuItem(group);
popup.appendChild(menuItem);
showEmpty = false;
isEmpty = false;
}
});
}
if (showEmpty) {
let menuItem = this._createGroupMenuItem(null);
popup.appendChild(menuItem);
}
document.getElementById("context_namedGroups").hidden = isEmpty;
},
_createGroupMenuItem : function(group) {
let menuItem = document.createElement("menuitem")
menuItem.setAttribute("class", "group");
if (group) {
menuItem.setAttribute("label", group.getTitle());
menuItem.setAttribute(
"oncommand",
"TabView.moveTabTo(TabContextMenu.contextTab,'" + group.id + "')");
} else {
menuItem.setAttribute(
"label", gNavigatorBundle.getString("tabView.noNamedGroup"));
menuItem.setAttribute("disabled", "true");
}
menuItem.setAttribute("label", group.getTitle());
menuItem.setAttribute(
"oncommand",
"TabView.moveTabTo(TabContextMenu.contextTab,'" + group.id + "')");
return menuItem;
},
@ -106,8 +95,7 @@ let TabView = {
moveTabTo: function(tab, groupId) {
let tabViewWindow = document.getElementById("tab-view").contentWindow;
if (tabViewWindow) {
if (tabViewWindow)
tabViewWindow.Groups.moveTabToGroup(tab, groupId);
}
}
};

View File

@ -120,7 +120,7 @@
<menuitem label="&createNewGroup.label;"
accesskey="&createNewGroup.accesskey;"
oncommand="TabView.moveTabTo(TabContextMenu.contextTab, null);" />
<menuitem id="context_namedGroup" label="&namedGroup.label;"
<menuitem id="context_namedGroups" label="&namedGroups.label;"
disabled="true" />
</menupopup>
</menu>

View File

@ -16,7 +16,7 @@
<!ENTITY moveTabTo.accesskey "M">
<!ENTITY createNewGroup.label "Create New Group">
<!ENTITY createNewGroup.accesskey "C">
<!ENTITY namedGroup.label "Named Group">
<!ENTITY namedGroups.label "Named Groups">
<!ENTITY reloadTab.label "Reload Tab">
<!ENTITY reloadTab.accesskey "R">
<!ENTITY reloadAllTabs.label "Reload All Tabs">

View File

@ -277,7 +277,6 @@ addKeywordTitleAutoFill=Search %S
# TabView
tabView.title=%S Tab Sets
tabView.noNamedGroup=(Empty)
extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.name=Default
extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.description=The default theme.