Skip to content

Commit 80ac168

Browse files
committed
Move JS specific to the SQL panel to its own file.
1 parent dbded64 commit 80ac168

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

debug_toolbar/static/debug_toolbar/js/toolbar.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,6 @@
9898
return false;
9999
});
100100

101-
// Used by the SQL panel -- in HTML generated by Python code
102-
$('#djDebug a.djDebugToggle').live('click', function(e) {
103-
e.preventDefault();
104-
$(this).parent().find('.djDebugCollapsed').toggle();
105-
$(this).parent().find('.djDebugUncollapsed').toggle();
106-
});
107-
108101
// Used by the cache, profiling and SQL panels
109102
$('#djDebug a.djToggleSwitch').live('click', function(e) {
110103
e.preventDefault();
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
(function (factory) {
2+
if (typeof define === 'function' && define.amd) {
3+
define(['jquery'], factory);
4+
} else {
5+
factory(jQuery);
6+
}
7+
}(function ($) {
8+
$('#djDebug a.djDebugToggle').on('click', function(e) {
9+
e.preventDefault();
10+
$(this).parent().find('.djDebugCollapsed').toggle();
11+
$(this).parent().find('.djDebugUncollapsed').toggle();
12+
});
13+
}));

debug_toolbar/templates/debug_toolbar/panels/sql.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,5 @@
9292
{% else %}
9393
<p>{% trans "No SQL queries were recorded during this request." %}</p>
9494
{% endif %}
95+
96+
<script src="{{ STATIC_URL }}debug_toolbar/js/toolbar.sql.js"></script>

0 commit comments

Comments
 (0)