mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
FIX Prevent popping open cms-menu when using nested gridfield
This commit is contained in:
parent
406198966a
commit
c8cbc470e8
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user