]> git.openstreetmap.org Git - rails.git/commitdiff
Show XHR responseText on error
authorJohn Firebaugh <john.firebaugh@gmail.com>
Wed, 13 Nov 2013 19:59:52 +0000 (11:59 -0800)
committerJohn Firebaugh <john.firebaugh@gmail.com>
Wed, 13 Nov 2013 20:01:21 +0000 (12:01 -0800)
app/assets/javascripts/index.js

index f6cb0223038c145e79852b6a0e84544d3fb9f84f..5724eaae8c2cdde831d4ca4dcd42c5cf91a0e1ab 100644 (file)
     }
 
     $('#sidebar_content')
-      .empty()
-      .load(path, function(a, b, xhr) {
+      .empty();
+
+    $.ajax({
+      url: path,
+      complete: function(xhr) {
         clearTimeout(loaderTimeout);
         $('#sidebar_loader').hide();
+        $('#sidebar_content').html(xhr.responseText);
         if (xhr.getResponseHeader('X-Page-Title')) {
           document.title = xhr.getResponseHeader('X-Page-Title');
         }
         if (callback) {
           callback();
         }
-      });
+      }
+    });
   };
 })();