From 5fb6e46cd28cd68806cbe6d16699bb5726fdc879 Mon Sep 17 00:00:00 2001 From: "mozilla.mano%sent.com" Date: Fri, 4 Apr 2008 18:01:15 +0000 Subject: [PATCH] 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 --- mozilla/browser/components/places/content/menu.xml | 8 +++++++- mozilla/browser/components/places/content/toolbar.xml | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mozilla/browser/components/places/content/menu.xml b/mozilla/browser/components/places/content/menu.xml index 0bde98fa744..3804a388109 100755 --- a/mozilla/browser/components/places/content/menu.xml +++ b/mozilla/browser/components/places/content/menu.xml @@ -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; ]]> diff --git a/mozilla/browser/components/places/content/toolbar.xml b/mozilla/browser/components/places/content/toolbar.xml index 43a6d6367ca..db7c4ecb4d0 100755 --- a/mozilla/browser/components/places/content/toolbar.xml +++ b/mozilla/browser/components/places/content/toolbar.xml @@ -947,7 +947,13 @@