1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-11 17:24:46 +02:00

Fix issue where using crop/resize tools on an image within a NESTED repeater item would not save the changes after clicking the Save button in the page editor.

This commit is contained in:
Ryan Cramer
2019-06-04 09:30:35 -04:00
parent ad2f60b544
commit a88c6a49c7
7 changed files with 54 additions and 17 deletions

View File

@@ -1459,18 +1459,21 @@ function InputfieldRequirements($target) {
*
*/
function InputfieldReloadEvent(event, extraData) {
console.log('InputfieldReloadEvent ' + $(this).attr('id'));
var $t = $(this);
var $form = $t.closest('form');
var fieldName = $t.attr('id').replace('wrap_Inputfield_', '');
var fnsx = ''; // field name suffix
var url = $form.attr('action');
if(fieldName.indexOf('_repeater') > 0) {
var pageID = $t.closest('.InputfieldRepeaterItem').attr('data-page');
var $repeaterItem = $t.closest('.InputfieldRepeaterItem');
var pageID = $repeaterItem.attr('data-page');
url = url.replace(/\?id=\d+/, '?id=' + pageID);
fnsx = $repeaterItem.attr('data-fnsx');
fieldName = fieldName.replace(/_repeater\d+$/, '');
}
url += url.indexOf('?') > -1 ? '&' : '?';
url += 'field=' + fieldName + '&reloadInputfieldAjax=' + fieldName;
if(fnsx.length) url += '&fnsx=' + fnsx;
if(typeof extraData != "undefined") {
if(typeof extraData['queryString'] != "undefined") {
url += '&' + extraData['queryString'];

File diff suppressed because one or more lines are too long