Skip to content

Commit 24cb6fa

Browse files
committed
Added error trapping to AJAX sub-panels.
Previous the user saw nothing happen if there was an error on the backend. This at least display a basic error status to the user.
1 parent a50ff2c commit 24cb6fa

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

debug_toolbar/media/debug_toolbar/js/toolbar.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@
4444
return false;
4545
});
4646
$('#djDebug a.remoteCall').click(function() {
47-
$('#djDebugWindow').load(this.href, {}, function() {
47+
$('#djDebugWindow').load(this.href, {}, function(response, status, xhr) {
48+
if (status == "error") {
49+
var message = '<div class="djDebugPanelTitle"><a class="djDebugClose djDebugBack" href="">Back</a><h3>'+xhr.status+': '+xhr.statusText+'</h3></div>';
50+
$('#djDebugWindow').html(message);
51+
}
4852
$('#djDebugWindow a.djDebugBack').click(function() {
4953
$(this).parent().parent().hide();
5054
return false;

debug_toolbar/media/debug_toolbar/js/toolbar.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)