Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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
Ingo Schommer chillu authored
6 admin/javascript/LeftAndMain.Content.js
View
@@ -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.
4 admin/javascript/LeftAndMain.js
View
@@ -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.