aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAymeric Augustin2014-02-13 21:35:17 +0100
committerAymeric Augustin2014-02-13 21:51:12 +0100
commit19ffd1e1d2604a5834e3e1b1c5ece01f091de073 (patch)
tree02b9256b75385041da6791225276c37f1a3197da
parent025091eb8a0d230314e1c205a51f6ef426151024 (diff)
downloaddjango-debug-toolbar-19ffd1e1d2604a5834e3e1b1c5ece01f091de073.tar.bz2
Add loading animation for panels. Fix #488.
-rw-r--r--debug_toolbar/static/debug_toolbar/css/toolbar.css5
-rw-r--r--debug_toolbar/static/debug_toolbar/img/ajax-loader.gifbin0 -> 404 bytes
-rw-r--r--debug_toolbar/static/debug_toolbar/js/toolbar.js1
-rw-r--r--debug_toolbar/templates/debug_toolbar/base.html1
4 files changed, 7 insertions, 0 deletions
diff --git a/debug_toolbar/static/debug_toolbar/css/toolbar.css b/debug_toolbar/static/debug_toolbar/css/toolbar.css
index f3a31b1..e6d0217 100644
--- a/debug_toolbar/static/debug_toolbar/css/toolbar.css
+++ b/debug_toolbar/static/debug_toolbar/css/toolbar.css
@@ -257,6 +257,11 @@
padding:5px 0 0 20px;
}
+#djDebug .djDebugPanelContent .loader {
+ display:block;
+ margin:80px auto;
+}
+
#djDebug .djDebugPanelContent .scroll {
height:100%;
overflow:auto;
diff --git a/debug_toolbar/static/debug_toolbar/img/ajax-loader.gif b/debug_toolbar/static/debug_toolbar/img/ajax-loader.gif
new file mode 100644
index 0000000..a7c3f2b
--- /dev/null
+++ b/debug_toolbar/static/debug_toolbar/img/ajax-loader.gif
Binary files differ
diff --git a/debug_toolbar/static/debug_toolbar/js/toolbar.js b/debug_toolbar/static/debug_toolbar/js/toolbar.js
index d8c1b27..126f399 100644
--- a/debug_toolbar/static/debug_toolbar/js/toolbar.js
+++ b/debug_toolbar/static/debug_toolbar/js/toolbar.js
@@ -39,6 +39,7 @@
url: render_panel_url
};
$.ajax(ajax_data).done(function(data){
+ inner.prev().remove(); // Remove AJAX loader
inner.html(data);
}).fail(function(xhr){
var message = '<div class="djDebugPanelTitle"><a class="djDebugClose djDebugBack" href="">Back</a><h3>'+xhr.status+': '+xhr.statusText+'</h3></div>';
diff --git a/debug_toolbar/templates/debug_toolbar/base.html b/debug_toolbar/templates/debug_toolbar/base.html
index e2ab939..22a13db 100644
--- a/debug_toolbar/templates/debug_toolbar/base.html
+++ b/debug_toolbar/templates/debug_toolbar/base.html
@@ -51,6 +51,7 @@ if(!window.jQuery) document.write('<scr'+'ipt src="//ajax.googleapis.com/ajax/li
<h3>{{ panel.title|safe }}</h3>
</div>
<div class="djDebugPanelContent">
+ <img src="{% static 'debug_toolbar/img/ajax-loader.gif' %}" alt="loading" class="loader">
<div class="scroll">
{% if not toolbar.store_id %}{{ panel.content }}{% endif %}
</div>