Skip to content

Commit

Permalink
Merge branch '4' into 5
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jun 27, 2024
2 parents e6be044 + 1b19846 commit b1d1cd4
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions javascript/GridFieldExtensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,34 +550,30 @@
data[parts[0]] = parts[1];
}
}
$.ajax({
type: 'POST',
url: $(this).attr('data-url'),
data: data,
fetch($(this).attr('data-url'), {
method: 'POST',
body: JSON.stringify(data),
headers: {
'X-Pjax': pjaxTarget
},
success: function(data) {
}
})
.then(response => response.json())
.then(data => {
if (data && data[pjaxTarget]) {
gridField.find(`[data-pjax-fragment="${pjaxTarget}"]`).replaceWith(data[pjaxTarget]);
}
}
});
});
}
else {
$(this).closest('tr').next('.nested-gridfield').show();
$.ajax({
url: $(this).attr('data-toggle')+'1'
});
fetch($(this).attr('data-toggle')+'1');
}
$(this).removeClass('font-icon-right-dir');
$(this).addClass('font-icon-down-dir');
$(this).attr('aria-expanded', 'true');
}
else {
$.ajax({
url: $(this).attr('data-toggle')+'0'
});
fetch($(this).attr('data-toggle')+'0');
$(this).closest('tr').next('.nested-gridfield').hide();
$(this).removeClass('font-icon-down-dir');
$(this).addClass('font-icon-right-dir');
Expand Down

0 comments on commit b1d1cd4

Please sign in to comment.