mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Refactor downloadAsFile to accept blob
This commit is contained in:
parent
38cbfe4fce
commit
6c50816830
@ -13,7 +13,7 @@
|
||||
var fileName = piskelName + '-' + timestamp + '.piskel';
|
||||
|
||||
try {
|
||||
pskl.utils.FileUtils.downloadAsFile(serialized, fileName);
|
||||
pskl.utils.FileUtils.downloadAsFile(new Blob([serialized]), fileName);
|
||||
deferred.resolve();
|
||||
} catch (e) {
|
||||
deferred.reject(e.message);
|
||||
|
@ -36,7 +36,7 @@
|
||||
saveAs(content, filename);
|
||||
} else {
|
||||
var downloadLink = document.createElement('a');
|
||||
content = window.URL.createObjectURL(new Blob([content]));
|
||||
content = window.URL.createObjectURL(content);
|
||||
downloadLink.setAttribute('href', content);
|
||||
downloadLink.setAttribute('download', filename);
|
||||
document.body.appendChild(downloadLink);
|
||||
|
Loading…
Reference in New Issue
Block a user