mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-19 09:30:44 +00:00
Fixes to the Set Folder.
This commit is contained in:
parent
f5c220547d
commit
298481f826
@ -163,6 +163,7 @@ function downloadChooseFolder() {
|
||||
var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
|
||||
var refLocalFile = Components.classes["@mozilla.org/file/local;1"].createInstance(nsIFile );
|
||||
fp.init(window, null, nsIFilePicker.modeSave);
|
||||
fp.defaultString="save_file_here";
|
||||
const nsILocalFile = Components.interfaces.nsILocalFile;
|
||||
|
||||
var customDirPref = document.getElementById("downloadDir");
|
||||
@ -173,12 +174,14 @@ function downloadChooseFolder() {
|
||||
fp.displayDirectory = fileCustomDirFile;
|
||||
}
|
||||
fp.appendFilters(nsIFilePicker.filterAll);
|
||||
|
||||
var returnFilePickerValue=fp.show();
|
||||
|
||||
if (returnFilePickerValue == nsIFilePicker.returnOK) {
|
||||
var file = fp.file.QueryInterface(nsILocalFile);
|
||||
var filepath = fp.file.QueryInterface(nsIFile);
|
||||
|
||||
var currentDirPref = document.getElementById("downloadDir");
|
||||
customDirPref.value = currentDirPref.value = file.path;
|
||||
customDirPref.value = currentDirPref.value = file.parent.path;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user