mirror of
https://github.com/nextcloud/passman.git
synced 2025-10-09 13:07:13 +08:00
[#264] Fix export file download in Firefox
This commit is contained in:
parent
784e71712f
commit
d7d19c02e7
2 changed files with 12 additions and 12 deletions
|
@ -67,7 +67,7 @@ PassmanExporter.csv.export = function (credentials, FileService, EncryptService)
|
||||||
file_data += row_data.join(',') + "\n";
|
file_data += row_data.join(',') + "\n";
|
||||||
}
|
}
|
||||||
this.call_then();
|
this.call_then();
|
||||||
download(file_data, 'passman-export.csv');
|
download(file_data, 'passman-export.csv', 'text/csv');
|
||||||
}).bind(this)).progress(function() {
|
}).bind(this)).progress(function() {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
22
js/vendor/download.js
vendored
22
js/vendor/download.js
vendored
|
@ -96,17 +96,17 @@
|
||||||
function saver(url, winMode){
|
function saver(url, winMode){
|
||||||
|
|
||||||
if ('download' in anchor) { //html5 A[download]
|
if ('download' in anchor) { //html5 A[download]
|
||||||
anchor.href = url;
|
var element = document.createElement('a');
|
||||||
anchor.setAttribute("download", fileName);
|
|
||||||
anchor.className = "download-js-link";
|
element.setAttribute('href', url);
|
||||||
anchor.innerHTML = "downloading...";
|
element.setAttribute('download', fileName);
|
||||||
anchor.style.display = "none";
|
element.style.display = 'none';
|
||||||
jQuery('.detailsView').append(anchor);
|
|
||||||
setTimeout(function() {
|
document.body.appendChild(element);
|
||||||
anchor.click();
|
element.click();
|
||||||
jQuery('.download-js-link').remove();
|
document.body.removeChild(element);
|
||||||
if(winMode===true){setTimeout(function(){ self.URL.revokeObjectURL(anchor.href);}, 250 );}
|
if(winMode===true){setTimeout(function(){ self.URL.revokeObjectURL(element.href);}, 250 );}
|
||||||
}, 66);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue