mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
replace Promise by Q.defer in ImageImport step
This commit is contained in:
parent
b7fe8c1a5e
commit
30274ad1f8
@ -60,7 +60,8 @@
|
|||||||
var name = this.extractFileNameFromPath_(this.file_.name);
|
var name = this.extractFileNameFromPath_(this.file_.name);
|
||||||
// Remove extension from filename.
|
// Remove extension from filename.
|
||||||
name = name.replace(/\.[a-zA-Z]+$/, '');
|
name = name.replace(/\.[a-zA-Z]+$/, '');
|
||||||
return new Promise(function (resolve, reject) {
|
|
||||||
|
var deferred = Q.defer();
|
||||||
pskl.app.importService.newPiskelFromImage(
|
pskl.app.importService.newPiskelFromImage(
|
||||||
this.importedImage_,
|
this.importedImage_,
|
||||||
{
|
{
|
||||||
@ -74,9 +75,9 @@
|
|||||||
smoothing: !!this.smoothResize.checked,
|
smoothing: !!this.smoothResize.checked,
|
||||||
name: name
|
name: name
|
||||||
},
|
},
|
||||||
resolve
|
deferred.resolve
|
||||||
);
|
);
|
||||||
}.bind(this));
|
return deferred.promise;
|
||||||
};
|
};
|
||||||
|
|
||||||
ns.ImageImport.prototype.onImportTypeChange_ = function (evt) {
|
ns.ImageImport.prototype.onImportTypeChange_ = function (evt) {
|
||||||
|
Loading…
Reference in New Issue
Block a user