mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-17 18:50:57 +01:00
Fixed regression with files in admin not allowing types other than images (fixes #1737)
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
# v1.9.9
|
||||
## mm/dd/2019
|
||||
|
||||
1. [](#bugfix)
|
||||
* Fixed regression with files in admin not allowing types other than images
|
||||
|
||||
# v1.9.8
|
||||
## 08/11/2019
|
||||
|
||||
|
||||
@@ -79,7 +79,9 @@ const ACCEPT_FUNC = function(file, done, settings) {
|
||||
|
||||
const reader = new FileReader();
|
||||
let error = '';
|
||||
if (resolution.min || (!(settings.resizeWidth || settings.resizeHeight) && resolution.max)) {
|
||||
const hasMin = (resolution.min && (resolution.min.width || resolution.min.height));
|
||||
const hasMax = (resolution.max && (resolution.max.width || resolution.max.height));
|
||||
if (hasMin || (!(settings.resizeWidth || settings.resizeHeight) && hasMax)) {
|
||||
reader.onload = function(event) {
|
||||
const image = new Image();
|
||||
image.src = event.target.result;
|
||||
@@ -102,13 +104,13 @@ const ACCEPT_FUNC = function(file, done, settings) {
|
||||
}
|
||||
}
|
||||
|
||||
done(error);
|
||||
return error ? done(error) : done();
|
||||
};
|
||||
};
|
||||
|
||||
reader.readAsDataURL(file);
|
||||
} else {
|
||||
return done(error);
|
||||
return error ? done(error) : done();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
4
themes/grav/js/admin.min.js
vendored
4
themes/grav/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user