Fixed unnecessary closing bracket cuasing JS error (fixes #2079)

This commit is contained in:
Djamil Legato
2021-02-22 09:24:33 -08:00
parent b7271bc424
commit 8d80d0f75e
3 changed files with 10 additions and 2 deletions

View File

@@ -2725,6 +2725,10 @@ var ACCEPT_FUNC = function ACCEPT_FUNC(file, done, settings) {
var image = new Image();
image.src = event.target.result;
image.onerror = function () {
done(external_GravAdmin_namespaceObject.translations.PLUGIN_ADMIN.FILE_ERROR_UPLOAD);
};
image.onload = function () {
var _this = this;
@@ -2746,6 +2750,8 @@ var ACCEPT_FUNC = function ACCEPT_FUNC(file, done, settings) {
}
}
URL.revokeObjectURL(image.src); // release memory
return error ? done(error) : done();
};
};
@@ -3068,6 +3074,7 @@ var addNode = function addNode(container) {
resizeWidth: settings.resizeWidth || null,
resizeHeight: settings.resizeHeight || null,
resizeQuality: settings.resizeQuality || null,
resolution: settings.resolution || null,
accept: function accept(file, done) {
ACCEPT_FUNC(file, done, settings);
}