Merge branch 'develop' into 1.10

# Conflicts:
#	CHANGELOG.md
#	blueprints.yaml
#	themes/grav/js/admin.min.js
This commit is contained in:
Andy Miller
2019-08-21 15:13:17 -06:00
4 changed files with 17 additions and 6 deletions

View File

@@ -67,6 +67,13 @@
1. [](#bugfix)
* Fixed admin caching issues
# v1.9.9
## 08/21/2019
1. [](#bugfix)
* Fixed regression with files in admin not allowing types other than images [#1737](https://github.com/getgrav/grav-plugin-admin/issues/1737)
* Fixed preview link for non-images files in **Page Media** [#1727](https://github.com/getgrav/grav-plugin-admin/issues/1727)
# v1.9.8
## 08/11/2019

View File

@@ -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();
}
};

View File

@@ -139,7 +139,9 @@ export default class PageMedia extends FilesField {
let file = target.parent('.dz-preview').find('.dz-filename');
let filename = encodeURI(file.text());
let URL = target.closest('[data-media-path]').data('media-path');
let original = this.dropzone.files.filter((file) => encodeURIComponent(file.name) === filename).shift().extras.original;
let original = this.dropzone.files.filter((file) => encodeURIComponent(file.name) === filename).shift();
original = original.extras.original || encodeURIComponent(original.name);
target.attr('href', `${URL}/${original}`);
});

File diff suppressed because one or more lines are too long