Bug 476020 - Pressing Esc while having the tag autocomplete open closes the bookmarks panel, r=dietrich a191=beltzner
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -108,22 +108,23 @@ var StarUI = {
if (this._batching) {
PlacesUIUtils.ptm.endBatch();
this._batching = false;
}
}
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();
}
}
else if (aEvent.keyCode == KeyEvent.DOM_VK_RETURN) {
// hide the panel unless the folder tree is focused
// or the tag autocomplete popup is open
if (aEvent.target.localName != "tree" &&
(aEvent.target.id != "editBMPanel_tagsField" ||
--- a/browser/components/places/tests/browser/browser_bookmarksProperties.js
+++ b/browser/components/places/tests/browser/browser_bookmarksProperties.js
@@ -291,17 +291,17 @@ gTests.push({
// Check that folder name has been changed.
is(PlacesUtils.bookmarks.getItemTitle(this._itemId), "n",
"Folder name has been edited");
// Cleanup.
PlacesUtils.bookmarks.removeItem(this._itemId);
}
});
-
+*/
//------------------------------------------------------------------------------
// Bug 476020 - Pressing Esc while having the tag autocomplete open closes the bookmarks panel
gTests.push({
desc: "Bug 476020 - Pressing Esc while having the tag autocomplete open closes the bookmarks panel",
sidebar: SIDEBAR_BOOKMARKS_ID,
action: ACTION_EDIT,
itemType: null,
@@ -355,17 +355,17 @@ gTests.push({
is(tags[0], "testTag", "Tag on node has not changed");
// Cleanup.
PlacesUtils.tagging.untagURI(PlacesUtils._uri(TEST_URL),
["testTag"]);
PlacesUtils.bookmarks.removeItem(this._itemId);
}
});
-*/
+
//------------------------------------------------------------------------------
function test() {
waitForExplicitFinish();
// Sanity checks.
ok(PlacesUtils, "PlacesUtils in context");
ok(PlacesUIUtils, "PlacesUIUtils in context");