mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
add blob type
This commit is contained in:
parent
85336f9b9a
commit
d947fe1c05
@ -13,7 +13,7 @@
|
||||
var fileName = piskelName + '-' + timestamp + '.piskel';
|
||||
|
||||
try {
|
||||
pskl.utils.FileUtils.downloadAsFile(new Blob([serialized]), fileName);
|
||||
pskl.utils.FileUtils.downloadAsFile(new Blob([serialized], {type : 'application/piskel+json'}), fileName);
|
||||
deferred.resolve();
|
||||
} catch (e) {
|
||||
deferred.reject(e.message);
|
||||
|
@ -8,9 +8,9 @@
|
||||
ns.FileUtils = {
|
||||
readFile : function (file, callback) {
|
||||
var reader = new FileReader();
|
||||
reader.onload = function (event) {
|
||||
callback(event.target.result);
|
||||
};
|
||||
reader.addEventListener('loadend', function() {
|
||||
callback(reader.result);
|
||||
});
|
||||
reader.readAsDataURL(file);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user