Part of fix for bug # 17333: add "Properties..." menuitem to context menu (if appropriate). Code from aaronr@us.ibm.com, review/slight mods: me.

This commit is contained in:
rjc%netscape.com 2000-03-15 03:27:34 +00:00
Родитель 1c02f1ca09
Коммит 154f9e9494
1 изменённых файлов: 26 добавлений и 0 удалений

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

@ -584,6 +584,32 @@ function fillContextMenu(name)
popupNode.appendChild(menuItem);
}
// if one and only one node is selected
if (treeNode.selectedItems.length == 1)
{
// and its a bookmark or a bookmark folder (there can be other types,
// not just separators, so check explicitly for what we allow)
var type = select_list[0].getAttribute("type");
if ((type == "http://home.netscape.com/NC-rdf#Bookmark") ||
(type == "http://home.netscape.com/NC-rdf#Folder"))
{
// then add a menu separator (if necessary)
if (popupNode.childNodes.length > 0)
{
var menuSep = document.createElement("menuseparator");
popupNode.appendChild(menuSep);
}
// and then add a "Properties" menu items
var propMenuName = "Properties...";
var menuItem = document.createElement("menuitem");
menuItem.setAttribute("value", "Properties..."); // XXX localize
menuItem.setAttribute("oncommand", "return BookmarkProperties();");
popupNode.appendChild(menuItem);
}
}
return(true);
}