Permalink
Browse files

MINOR Supporting X-ControllerURL in form submits

  • Loading branch information...
1 parent 2ec40f8 commit ee2b2207801f61e7a76138aeb416d8acd7c8f829 @chillu chillu committed Mar 8, 2012
Showing with 9 additions and 3 deletions.
  1. +9 −3 admin/javascript/LeftAndMain.Content.js
@@ -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));

0 comments on commit ee2b220

Please sign in to comment.