Bug 476020 - Pressing Esc while having the tag autocomplete open closes the bookmarks panel, r=dietrich

This commit is contained in:
Marco Bonardo 2009-01-30 13:34:38 +01:00
parent 9bbf429fa6
commit 018df7819f

View File

@ -113,12 +113,13 @@ var StarUI = {
break;
case "keypress":
if (aEvent.keyCode == KeyEvent.DOM_VK_ESCAPE) {
// In edit mode, if we're not editing a folder, the ESC key is mapped
// to the cancel button
// If the panel is visible the ESC key is mapped to the cancel button
// unless we are editing a folder in the folderTree, or an
// autocomplete popup is open.
if (!this._element("editBookmarkPanelContent").hidden) {
var elt = aEvent.target;
if (elt.localName != "tree" ||
(elt.localName == "tree" && !elt.hasAttribute("editing")))
if ((elt.localName != "tree" || !elt.hasAttribute("editing")) &&
!elt.popupOpen)
this.cancelButtonOnCommand();
}
}