replace Promise by Q.defer in ImageImport step

This commit is contained in:
juliandescottes 2017-04-04 00:59:23 +02:00 committed by Julian Descottes
parent b7fe8c1a5e
commit 30274ad1f8

View File

@ -60,7 +60,8 @@
var name = this.extractFileNameFromPath_(this.file_.name);
// Remove extension from filename.
name = name.replace(/\.[a-zA-Z]+$/, '');
return new Promise(function (resolve, reject) {
var deferred = Q.defer();
pskl.app.importService.newPiskelFromImage(
this.importedImage_,
{
@ -74,9 +75,9 @@
smoothing: !!this.smoothResize.checked,
name: name
},
resolve
deferred.resolve
);
}.bind(this));
return deferred.promise;
};
ns.ImageImport.prototype.onImportTypeChange_ = function (evt) {