mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-26 02:02:33 +00:00
Bug 1085158 - FilePicker.js should use its parent window for the creation of File object, r=bz
This commit is contained in:
parent
ee2a1a8d27
commit
04ab44d36f
@ -10,6 +10,8 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
|
||||
Cu.importGlobalProperties(['File']);
|
||||
|
||||
function FilePicker() {
|
||||
}
|
||||
|
||||
@ -143,12 +145,22 @@ FilePicker.prototype = {
|
||||
if (!f) {
|
||||
return null;
|
||||
}
|
||||
return File(f);
|
||||
|
||||
if (this._domWin) {
|
||||
return new this._domWin.File(f);
|
||||
}
|
||||
|
||||
return new File(f);
|
||||
},
|
||||
|
||||
get domfiles() {
|
||||
let win = this._domWin;
|
||||
return this.getEnumerator([this.file], function(file) {
|
||||
return File(file);
|
||||
if (win) {
|
||||
return new win.File(file);
|
||||
}
|
||||
|
||||
return new File(file);
|
||||
});
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user