1
0
Fork 0
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:
Harvey Kandola 2019-01-20 16:49:32 +00:00
parent e737339090
commit e8735ffc12

View file

@ -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);
}
}
});