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';
|
var fileName = piskelName + '-' + timestamp + '.piskel';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pskl.utils.FileUtils.downloadAsFile(new Blob([serialized]), fileName);
|
pskl.utils.FileUtils.downloadAsFile(new Blob([serialized], {type : 'application/piskel+json'}), fileName);
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
deferred.reject(e.message);
|
deferred.reject(e.message);
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
ns.FileUtils = {
|
ns.FileUtils = {
|
||||||
readFile : function (file, callback) {
|
readFile : function (file, callback) {
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
reader.onload = function (event) {
|
reader.addEventListener('loadend', function() {
|
||||||
callback(event.target.result);
|
callback(reader.result);
|
||||||
};
|
});
|
||||||
reader.readAsDataURL(file);
|
reader.readAsDataURL(file);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user