Bug 481121: Misc minor bookmark bugs, r=gavin

This commit is contained in:
Mark Finkle 2009-03-03 09:31:51 -05:00
parent 4ea1985051
commit 7f61c78f84
2 changed files with 7 additions and 2 deletions

View File

@ -325,6 +325,7 @@
</body>
</method>
<method name="startEditing">
<parameter name="autoSelect"/>
<body>
<![CDATA[
if (this._itemId == -1)
@ -342,6 +343,8 @@
}
this._nameField.focus();
if (autoSelect)
this._nameField.select();
]]>
</body>
</method>
@ -690,6 +693,8 @@
while (children.firstChild)
children.removeChild(children.firstChild);
children.scrollBoxObject.scrollTo(0, 0);
let childItems = this._getChildren(aRootFolder);
for (let i=0; i<childItems.length; i++) {
let node = childItems[i];
@ -717,7 +722,7 @@
let children = this._children;
let newId = PlacesUtils.bookmarks.createFolder(parent.itemId, this._bundle.GetStringFromName("editBookmarkNewFolder"), PlacesUtils.bookmarks.DEFAULT_INDEX);
let child = this.appendItem(newId, Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER, children.lastChild);
child.startEditing();
child.startEditing(true);
}
]]>
</body>

View File

@ -562,7 +562,7 @@ var BrowserUI = {
case "cmd_star":
{
var bookmarkURI = browser.currentURI;
var bookmarkTitle = browser.contentDocument.title;
var bookmarkTitle = browser.contentDocument.title || bookmarkURI.spec;
if (PlacesUtils.getMostRecentBookmarkForURI(bookmarkURI) == -1) {
var bookmarkId = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.bookmarks.bookmarksMenuFolder, bookmarkURI, PlacesUtils.bookmarks.DEFAULT_INDEX, bookmarkTitle);