Pass the field name to the controller task

This commit is contained in:
Djamil Legato
2019-06-07 17:20:31 -07:00
parent f34e7b53e8
commit 2a1ba67822
3 changed files with 6 additions and 4 deletions

View File

@@ -120,7 +120,8 @@ export class Parents {
url: `${gravConfig.base_url_relative}/ajax.json/task${gravConfig.param_sep}getFolderListing`,
method: 'post',
data: {
route: b64_encode_unicode(parent.value)
route: b64_encode_unicode(parent.value),
field: this.field.data('fieldName')
},
success: (response) => {
this.stopLoader();
@@ -182,6 +183,7 @@ $(document).on('click', '[data-field-parents]', (event) => {
method: 'post',
data: {
route: b64_encode_unicode(field.val()),
field: field.data('fieldName'),
initial: true
},
success(response) {

File diff suppressed because one or more lines are too long

View File

@@ -18,7 +18,7 @@
<span><i class="fa fa-folder-o"></i> <span data-parents-field-label="{{ name }}">{{ value|default('<root>') }}</span></span>
</div>
<input type="hidden" class="input" name="{{ name }}" value="{{ value|join(', ') }}" />
<input type="hidden" class="input" name="{{ name }}" data-field-name="{{ field.name }}" value="{{ value|join(', ') }}" />
</div>
{#{% set last_page_route = admin.page.getLastPageRoute %}