Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR Skip processing in CMS on empty ajax responses, as they're usua…

…lly a pseudo redirect (via X-ControllerURL)
  • Loading branch information...
commit aebbb10c9f65a67497e3ea5b3ab0256d3c5ebba0 1 parent e01b0aa
@chillu chillu authored
View
6 admin/javascript/LeftAndMain.Content.js
@@ -83,11 +83,11 @@
* (XMLHTTPRequest) xmlhttp
*/
loadForm_responseHandler: function(oldForm, html, status, xmlhttp) {
+ if(!html) return;
if(oldForm.length > 0) {
oldForm.replaceWith(html); // triggers onmatch() on form
- }
- else {
+ } else {
$('.cms-content').append(html);
}
@@ -199,6 +199,8 @@
*/
submitForm_responseHandler: function(oldForm, data, status, xmlhttp, origData) {
if(status == 'success') {
+ if(!data) return;
+
var form, newContent = $(data);
// HACK If response contains toplevel panel rather than a form, replace it instead.
View
4 admin/javascript/LeftAndMain.js
@@ -227,6 +227,10 @@ jQuery.noConflict();
headers: headers,
url: state.url,
success: function(data, status, xhr) {
+ // Pseudo-redirects via X-ControllerURL might return empty data, in which
+ // case we'll ignore the response
+ if(!data) return;
+
// Update title
var title = xhr.getResponseHeader('X-Title');
if(title) document.title = title;
Please sign in to comment.
Something went wrong with that request. Please try again.