Remove near-useless "Expand" item on bookmark menuitem context menus p=paradigmk@technodrome.com r=me

This commit is contained in:
neil%parkwaycc.co.uk 2007-05-05 04:37:31 +00:00
Родитель 00bdbe0431
Коммит cead22a3db
1 изменённых файлов: 16 добавлений и 2 удалений

Просмотреть файл

@ -186,7 +186,7 @@ var BookmarksCommand = {
while (popup.hasChildNodes())
popup.removeChild(popup.firstChild);
var commonCommands = [];
var commonCommands = this.flattenEnumerator(this.getValidCommands(popup.id));
for (var i = 0; i < aSelection.length; ++i) {
var commands = this.getCommands(aSelection.item[i]);
if (!commands) {
@ -194,7 +194,6 @@ var BookmarksCommand = {
return;
}
commands = this.flattenEnumerator(commands);
if (!commonCommands.length) commonCommands = commands;
commonCommands = this.findCommonNodes(commands, commonCommands);
}
@ -331,6 +330,21 @@ var BookmarksCommand = {
return new CommandArrayEnumerator(commands);
},
/////////////////////////////////////////////////////////////////////////////
// For a given target ID, return an enumeration that contains the possible
// commands.
getValidCommands: function (aTargetID)
{
var valid = ["bm_open", "bm_openinnewwindow", "bm_openinnewtab", "bm_managefolder",
"bm_separator", "bm_newfolder", "bm_sortfolder", "bm_sortfolderbyname",
"bm_cut", "bm_copy", "bm_paste", "bm_movebookmark", "bm_rename",
"bm_delete", "bm_properties"];
if (aTargetID != "bookmarks-context-menu")
valid.push("bm_expandfolder");
return new CommandArrayEnumerator(valid);
},
/////////////////////////////////////////////////////////////////////////////
// Retrieve the human-readable name for a particular command. Used when