mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Supporting X-ControllerURL in form submits
This commit is contained in:
parent
2ec40f888a
commit
ee2b220780
@ -158,17 +158,23 @@
|
||||
if(loadResponse !== false) {
|
||||
self.submitForm_responseHandler(form, xmlhttp.responseText, status, xmlhttp, formData);
|
||||
}
|
||||
|
||||
// Simulates a redirect on an ajax response - just exchange the URL without re-requesting it
|
||||
if(window.History.enabled) {
|
||||
var url = xmlhttp.getResponseHeader('X-ControllerURL');
|
||||
if(url) window.history.replaceState({}, '', url);
|
||||
}
|
||||
|
||||
// Re-init tabs (in case the form tag itself is a tabset)
|
||||
if(self.hasClass('ss-tabset')) self.removeClass('ss-tabset').addClass('ss-tabset');
|
||||
|
||||
// Redraw the layout
|
||||
jQuery('.cms-container').entwine('ss').redraw();
|
||||
|
||||
// re-select previously saved tabs
|
||||
$.each(selectedTabs, function(i, selectedTab) {
|
||||
form.find('#' + selectedTab.id).tabs('select', selectedTab.selected);
|
||||
});
|
||||
|
||||
// Redraw the layout
|
||||
$('.cms-container').redraw();
|
||||
},
|
||||
dataType: 'html'
|
||||
}, ajaxOptions));
|
||||
|
Loading…
x
Reference in New Issue
Block a user