mirror of
https://github.com/documize/community.git
synced 2025-07-25 16:19:46 +02:00
Fix issue with MS Edge not downloading export HTML file
This commit is contained in:
parent
e737339090
commit
e8735ffc12
1 changed files with 13 additions and 10 deletions
|
@ -55,12 +55,14 @@ export default Service.extend({
|
|||
downloadFile(content, filename) {
|
||||
let b = new Blob([content], { type: 'text/html' });
|
||||
|
||||
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
|
||||
window.navigator.msSaveOrOpenBlob(b, filename);
|
||||
} else {
|
||||
let a = document.createElement("a");
|
||||
a.style = "display: none";
|
||||
a.style = "display: none;";
|
||||
document.body.appendChild(a);
|
||||
|
||||
let url = window.URL.createObjectURL(b);
|
||||
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
|
@ -68,4 +70,5 @@ export default Service.extend({
|
|||
window.URL.revokeObjectURL(url);
|
||||
document.body.removeChild(a);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue