From f35388036ad7b049c3df281703307babdf889f34 Mon Sep 17 00:00:00 2001 From: "mozilla.mano%sent.com" Date: Wed, 29 Aug 2007 22:50:14 +0000 Subject: [PATCH] Backing out 392820, tree was closed. --- browser/base/content/browser-places.js | 51 ++------------------------ 1 file changed, 4 insertions(+), 47 deletions(-) diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js index 20bee7903fa..399675fffa3 100644 --- a/browser/base/content/browser-places.js +++ b/browser/base/content/browser-places.js @@ -53,48 +53,12 @@ var PlacesCommandHook = { return document.getElementById("editBookmarkPanel"); }, - // list of command elements (by id) to disable when the panel is opened - _blockedCommands: ["cmd_close", "cmd_closeWindow"], - - _blockCommands: function PCH__blockCommands() { - for each(var key in this._blockedCommands) { - var elt = document.getElementById(key); - if (elt.getAttribute("disabled") == "true") - elt.setAttribute("wasDisabled", "true"); - else { - elt.setAttribute("wasDisabled", "false"); - elt.setAttribute("disabled", "true"); - } - } - }, - - _restoreCommandsState: function PCH__restoreCommandsState() { - for each(var key in this._blockedCommands) { - var elt = document.getElementById(key); - if (elt.getAttribute("wasDisabled") != "true") - elt.removeAttribute("disabled"); - elt.removeAttribute("wasDisabled"); - } - }, - // nsIDOMEventListener handleEvent: function PCH_handleEvent(aEvent) { - switch (aEvent.type) { - case "popuphiding": - if (aEvent.originalTarget == this.panel) { - gEditItemOverlay.uninitPanel(true); - this._restoreCommandsState(); - } - break; - case "keypress": - if (aEvent.keyCode == KeyEvent.DOM_VK_ESCAPE || - aEvent.keyCode == KeyEvent.DOM_VK_RETURN) { - // focus the content area and hide the panel - window.content.focus(); - this.panel.hidePopup(); - } - break; - } + if (aEvent.originalTarget != this.panel) + return; + + gEditItemOverlay.uninitPanel(true); }, _overlayLoaded: false, @@ -134,17 +98,10 @@ var PlacesCommandHook = { _doShowEditBookmarkPanel: function PCH__doShowEditBookmarkPanel(aItemId, aAnchorElement, aPosition) { - this.panel.addEventListener("keypress", this, true); - this._blockCommands(); // un-done in the popuphiding handler this.panel.openPopup(aAnchorElement, aPosition, -1, -1); gEditItemOverlay.initPanel(aItemId, { hiddenRows: ["description", "location"] }); - setTimeout(function() { - var namePicker = document.getElementById("editBMPanel_namePicker"); - namePicker.focus(); - namePicker.editor.selectAll(); - }, 0); }, /**