From 19ffd1e1d2604a5834e3e1b1c5ece01f091de073 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Thu, 13 Feb 2014 21:35:17 +0100 Subject: Add loading animation for panels. Fix #488. --- debug_toolbar/static/debug_toolbar/css/toolbar.css | 5 +++++ debug_toolbar/static/debug_toolbar/img/ajax-loader.gif | Bin 0 -> 404 bytes debug_toolbar/static/debug_toolbar/js/toolbar.js | 1 + debug_toolbar/templates/debug_toolbar/base.html | 1 + 4 files changed, 7 insertions(+) create mode 100644 debug_toolbar/static/debug_toolbar/img/ajax-loader.gif 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 Binary files /dev/null and b/debug_toolbar/static/debug_toolbar/img/ajax-loader.gif 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 = '
Back

'+xhr.status+': '+xhr.statusText+'

'; 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(' + loading
{% if not toolbar.store_id %}{{ panel.content }}{% endif %}
-- cgit v1.2.3