diff options
| author | Aymeric Augustin | 2013-11-13 20:35:34 +0100 |
|---|---|---|
| committer | Aymeric Augustin | 2013-11-13 20:35:34 +0100 |
| commit | a3acf6b57275f2a14cde7c209a8b6dff107275b0 (patch) | |
| tree | 0bf62bc1dbc0b49f50089c4eb86e813f566240fd /debug_toolbar | |
| parent | dc136eaceda6b689303e069f54c2dbc220c27854 (diff) | |
| download | django-debug-toolbar-a3acf6b57275f2a14cde7c209a8b6dff107275b0.tar.bz2 | |
Load panels content only one.
.empty() wasn't working like I expected.
Diffstat (limited to 'debug_toolbar')
| -rw-r--r-- | debug_toolbar/static/debug_toolbar/js/toolbar.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/debug_toolbar/static/debug_toolbar/js/toolbar.js b/debug_toolbar/static/debug_toolbar/js/toolbar.js index 9234c7c..e2e4c7d 100644 --- a/debug_toolbar/static/debug_toolbar/js/toolbar.js +++ b/debug_toolbar/static/debug_toolbar/js/toolbar.js @@ -27,17 +27,20 @@ $(this).parent().removeClass('active'); } else { $('.panelContent').hide(); // Hide any that are already open - var inner = current.find('.djDebugPanelContent .scroll').first(); - if ($(inner).empty()) { + var inner = current.find('.djDebugPanelContent .scroll').first(), + storage_id = $('#djDebug').data('storage-id'), + render_panel_url = $('#djDebug').data('render-panel-url'); + if (storage_id !== '' && inner.data('loaded') !== 'true') { var ajax_data = { data: { - storage_id: $('#djDebug').data('storage-id'), + storage_id: storage_id, panel_id: this.className }, type: 'GET', - url: $('#djDebug').data('render-panel-url') + url: render_panel_url }; $.ajax(ajax_data).done(function(data){ + inner.data('loaded', 'true'); 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>'; |
