Disable the delete menuitem when no places node is explicitly selected. r=dietrich.

git-svn-id: svn://10.0.0.236/trunk@249620 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mozilla.mano%sent.com
2008-04-04 18:01:15 +00:00
parent 9b7e9f5154
commit 5fb6e46cd2
2 changed files with 14 additions and 2 deletions

View File

@@ -931,7 +931,13 @@
this._ensureInitialized();
this._contextMenuShown = true;
this.focus();
return this.controller.buildContextMenu(aPopup);
var show = this.controller.buildContextMenu(aPopup);
if (show) {
// disable the Delete command if the selection isn't explicit
if (document.popupNode && document.popupNode.localName == "menupopup")
document.getElementById("cmd_delete").setAttribute("disabled", "true");
}
return false;
]]></body>
</method>

View File

@@ -947,7 +947,13 @@
<body><![CDATA[
this._contextMenuShown = true;
this.focus();
return this.controller.buildContextMenu(aPopup);
var show = this.controller.buildContextMenu(aPopup);
if (show) {
// disable the Delete command if the selection isn't explicit
if (document.popupNode && document.popupNode.localName == "menupopup")
document.getElementById("cmd_delete").setAttribute("disabled", "true");
}
return false;
]]></body>
</method>