From c30016ce74431700a7484f9f925da55aba67dca7 Mon Sep 17 00:00:00 2001 From: "vladimir%pobox.com" Date: Fri, 2 Sep 2005 20:21:10 +0000 Subject: [PATCH] b=268553, can't add a new folder on the bookmarks toolbar after having deleted a folder, r=mano,a=asa git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@179569 18797224-902f-48f8-a5cc-f745e15eee43 --- .../bookmarks/content/bookmarksMenu.js | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/mozilla/browser/components/bookmarks/content/bookmarksMenu.js b/mozilla/browser/components/bookmarks/content/bookmarksMenu.js index e2d1c90c45a..e7cf56988df 100644 --- a/mozilla/browser/components/bookmarks/content/bookmarksMenu.js +++ b/mozilla/browser/components/bookmarks/content/bookmarksMenu.js @@ -213,19 +213,22 @@ var BookmarksMenu = { // Clean up after closing the context menu popup destroyContextMenu: function (aEvent) { -# note that this method is called after doCommand. -# let''s focus the content and dismiss the popup chain (needed when the user -# type escape or if he/she clicks outside the context menu) + // note that this method is called after doCommand. + // let's focus the content and dismiss the popup chain (needed when the user + // type escape or if he/she clicks outside the context menu) if (content) content.focus(); // XXXpch: see bug 210910, it should be done properly in the backend BookmarksMenuDNDObserver.mCurrentDragOverTarget = null; BookmarksMenuDNDObserver.onDragCloseTarget(); -# if the user types escape, we need to remove the feedback + // if the user types escape, we need to remove the feedback BookmarksMenuDNDObserver.onDragRemoveFeedBack(document.popupNode); - aEvent.target.removeEventListener("mousemove", BookmarksMenuController.onMouseMove, false) + aEvent.target.removeEventListener("mousemove", BookmarksMenuController.onMouseMove, false); + + this._target = null; + this._selection = null; }, ///////////////////////////////////////////////////////////////////////////// @@ -477,16 +480,16 @@ var BookmarksMenuController = { doCommand: function (aCommand) { -# we needed to focus the element that has the bm command controller -# to get here. Now, let''s focus the content before performing the command: -# if a modal dialog is called from now, the content will be focused again -# automatically after dismissing the dialog + // we needed to focus the element that has the bm command controller + // to get here. Now, let's focus the content before performing the command: + // if a modal dialog is called from now, the content will be focused again + // automatically after dismissing the dialog if (content) content.focus(); BookmarksMenuDNDObserver.onDragRemoveFeedBack(document.popupNode); -# if a dialog opens, the "open" attribute of a menuitem-container -# rclicked on won''t be removed. We do it manually. + // if a dialog opens, the "open" attribute of a menuitem-container + // clicked on won't be removed. We do it manually. var element = document.popupNode.firstChild; if (element && element.localName == "menupopup") element.hidePopup(); @@ -711,7 +714,7 @@ var BookmarksMenuDNDObserver = { if (!this._observers) { this._observers = [ document.getElementById("bookmarks-ptf"), -# menubar menus haven''t an "open" attribute: we can take the child + // menubar menus haven't an "open" attribute: we can take the child document.getElementById("bookmarks-menu").firstChild, document.getElementById("bookmarks-chevron").parentNode ]