Fixing all (I think) drag and drop issues between the content area, the personal toolbar, and the bookmarks panel/manager. Includes the inability to drag a bookmark with no name, many links dragged to the bookmarks panel not having a title (79600), and bookmarks dragged to personal toolbar having names like "NC:BookmarksRoot" (85328). r=kerz sr=ben

This commit is contained in:
blakeross%telocity.com 2006-09-14 05:57:27 +00:00
parent 5271ea244d
commit 198236ff7d

View File

@ -129,7 +129,17 @@ var personalToolbarObserver = {
var linkCharset = aDragSession.sourceDocument ? aDragSession.sourceDocument.characterSet : null;
// determine title of link
var linkTitle;
if (xferData.length >= 2)
// look it up in bookmarks
var bookmarksDS = gRDFService.GetDataSource("rdf:bookmarks");
var nameRes = RDFUtils.getResource(NC_RDF("Name"));
var nameFromBookmarks = bookmarksDS.GetTarget(elementRes, nameRes, true);
if (nameFromBookmarks)
nameFromBookmarks = nameFromBookmarks.QueryInterface(Components.interfaces.nsIRDFLiteral);
if (nameFromBookmarks) {
linkTitle = nameFromBookmarks.Value;
}
else if (xferData.length >= 2)
linkTitle = xferData[1]
else
{