Make "save link as" work in the context menu on files in the XUL

dirviewer.  Bug 124762, r=bbaetz, sr=jag.
This commit is contained in:
bzbarsky%mit.edu 2002-02-12 00:41:22 +00:00
parent bbabfda7e9
commit 3e0b8d4c3e

View File

@ -303,7 +303,15 @@ nsContextMenu.prototype = {
if ( root.getAttribute( "URL" ) ) {
// Build pseudo link object so link-related functions work.
this.onLink = true;
this.link = { href : root.getAttribute("URL") };
this.link = { href : root.getAttribute("URL"),
getAttribute: function (attr) {
if (attr == "title") {
return root.firstChild.firstChild.getAttribute("label");
} else {
return "";
}
}
};
// If element is a directory, then you can't save it.
if ( root.getAttribute( "container" ) == "true" ) {
this.onSaveableLink = false;