MINOR Supporting X-ControllerURL in form submits

This commit is contained in:
Ingo Schommer 2012-03-08 17:24:17 +01:00
parent 2ec40f888a
commit ee2b220780

View File

@ -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));