Merge branch 'release/1.6.6'

This commit is contained in:
Andy Miller
2017-10-27 11:53:22 -06:00
5 changed files with 38 additions and 26 deletions

View File

@@ -1,3 +1,9 @@
# v1.6.6
## 10/27/2017
1. [](#new)
* Fixed issue where sortable media in expert mode would reset frontmatter [#1252](https://github.com/getgrav/grav-plugin-admin/issues/1252)
# v1.6.5
## 10/26/2017

View File

@@ -1,5 +1,5 @@
name: Admin Panel
version: 1.6.5
version: 1.6.6
description: Adds an advanced administration panel to manage your site
icon: empire
author:

View File

@@ -44,6 +44,9 @@ export default class PageMedia extends FilesField {
this.attachDragDrop();
}
const field = $(`[name="${this.container.data('dropzone-field')}"]`);
if (field.length) {
this.sortable = new Sortable(this.container.get(0), {
animation: 150,
// forceFallback: true,
@@ -57,7 +60,6 @@ export default class PageMedia extends FilesField {
dataTransfer.setData('text', shortcode);
},
onSort: () => {
const field = $(`[name="${this.container.data('dropzone-field')}"]`);
let names = [];
this.container.find('[data-dz-name]').each((index, file) => {
file = $(file);
@@ -69,6 +71,7 @@ export default class PageMedia extends FilesField {
}
});
}
}
fetchMedia() {
let url = this.urls.fetch;

File diff suppressed because one or more lines are too long

View File

@@ -15,7 +15,10 @@
data-media-path="{{ url(context.relativePagePath) }}"
data-dropzone-options="{{ dropzoneSettings|json_encode|e('html_attr') }}"
data-dropzone-field="{{ (scope ~ field.name)|fieldName }}"></div>
{% if admin.session.expert == '0' %}
<input type="hidden" name="{{ (scope ~ field.name)|fieldName }}" value="{{ value|e }}" />
{% endif %}
</div>
</div>
{% else %}