From 1f0fcf9838196698d397fda1cfbe4fcbcf632b41 Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Mon, 20 Jun 2005 09:03:06 +0000 Subject: [PATCH] File Bookmark should preselect New Bookmarks folder b=250783 p=f.qu@laposte.net r+sr=me a=asa git-svn-id: svn://10.0.0.236/trunk@174841 18797224-902f-48f8-a5cc-f745e15eee43 --- .../components/bookmarks/resources/addBookmark.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mozilla/xpfe/components/bookmarks/resources/addBookmark.js b/mozilla/xpfe/components/bookmarks/resources/addBookmark.js index 6ef391db2c1..d8185655eae 100644 --- a/mozilla/xpfe/components/bookmarks/resources/addBookmark.js +++ b/mozilla/xpfe/components/bookmarks/resources/addBookmark.js @@ -62,7 +62,7 @@ * window.arguments[3]: Bookmark Charset. The charset that should be * used when adding a bookmark to the specified * URL. (Usually the charset of the current - * document when launching this window). + * document when launching this window). * window.arguments[4]: The mode of operation. See notes for details. * window.arguments[5]: If the mode is "addGroup", this is an array * of objects with name, URL and charset @@ -175,8 +175,14 @@ function Startup() } } - if ((arg != "newBookmark") && (bookmarkView.currentIndex == -1)) - bookmarkView.tree.view.selection.select(0); + if ((arg != "newBookmark") && (bookmarkView.currentIndex == -1)) { + var folder = BookmarksUtils.getNewBookmarkFolder(); + ind = bookmarkView.treeBuilder.getIndexOfResource(folder); + if (ind != -1) + bookmarkView.tree.view.selection.select(ind); + else + bookmarkView.tree.view.selection.select(0); + } if (shouldSetOKButton) onFieldInput();