68109 - Use Default button in Add Bookmark dialog doesn't work. r=hewitt sr=ben a=asa

This commit is contained in:
blakeross%telocity.com 2007-05-05 04:35:28 +00:00
Родитель 21bbb0c3ab
Коммит a133e75a2d
1 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -249,14 +249,16 @@ function useDefaultFolder ()
{
const kBMDS = kRDF.GetDataSource("rdf:bookmarks");
var bookmarkView = document.getElementById("bookmarks-view");
// XXX Only the personal toolbar folder has a special folder URI
// This needs to look for the resource with the NC_NC + "FolderType" of "NC:NewBookmarkFolder"
var newBookmarkFolder = bookmarkView.rdf.GetResource("NC:NewBookmarkFolder");
var ind = bookmarkView.outlinerBuilder.getIndexOfResource(newBookmarkFolder);
var sources = kBMDS.GetSources(bookmarkView.rdf.GetResource(NC_NS + "FolderType"), bookmarkView.rdf.GetResource("NC:NewBookmarkFolder"), true);
var folder = null;
if (sources.hasMoreElements()) {
folder = sources.getNext().QueryInterface(Components.interfaces.nsIRDFResource);
}
var ind = bookmarkView.outlinerBuilder.getIndexOfResource(folder);
if (ind != -1) {
bookmarkView.outliner.focus();
bookmarkView.outlinerBoxObject.selection.select(ind);
gCreateInFolder = "NC:NewBookmarkFolder";
gCreateInFolder = folder.Value;
}
else {
bookmarkView.outlinerBoxObject.selection.clearSelection();