aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debug_toolbar/static/debug_toolbar/js/toolbar.js7
-rw-r--r--debug_toolbar/static/debug_toolbar/js/toolbar.sql.js13
-rw-r--r--debug_toolbar/templates/debug_toolbar/panels/sql.html2
3 files changed, 15 insertions, 7 deletions
diff --git a/debug_toolbar/static/debug_toolbar/js/toolbar.js b/debug_toolbar/static/debug_toolbar/js/toolbar.js
index c5afb31..1185ef7 100644
--- a/debug_toolbar/static/debug_toolbar/js/toolbar.js
+++ b/debug_toolbar/static/debug_toolbar/js/toolbar.js
@@ -98,13 +98,6 @@
return false;
});
- // Used by the SQL panel -- in HTML generated by Python code
- $('#djDebug a.djDebugToggle').live('click', function(e) {
- e.preventDefault();
- $(this).parent().find('.djDebugCollapsed').toggle();
- $(this).parent().find('.djDebugUncollapsed').toggle();
- });
-
// Used by the cache, profiling and SQL panels
$('#djDebug a.djToggleSwitch').live('click', function(e) {
e.preventDefault();
diff --git a/debug_toolbar/static/debug_toolbar/js/toolbar.sql.js b/debug_toolbar/static/debug_toolbar/js/toolbar.sql.js
new file mode 100644
index 0000000..c554bce
--- /dev/null
+++ b/debug_toolbar/static/debug_toolbar/js/toolbar.sql.js
@@ -0,0 +1,13 @@
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['jquery'], factory);
+ } else {
+ factory(jQuery);
+ }
+}(function ($) {
+ $('#djDebug a.djDebugToggle').on('click', function(e) {
+ e.preventDefault();
+ $(this).parent().find('.djDebugCollapsed').toggle();
+ $(this).parent().find('.djDebugUncollapsed').toggle();
+ });
+}));
diff --git a/debug_toolbar/templates/debug_toolbar/panels/sql.html b/debug_toolbar/templates/debug_toolbar/panels/sql.html
index 54babfc..d454d61 100644
--- a/debug_toolbar/templates/debug_toolbar/panels/sql.html
+++ b/debug_toolbar/templates/debug_toolbar/panels/sql.html
@@ -92,3 +92,5 @@
{% else %}
<p>{% trans "No SQL queries were recorded during this request." %}</p>
{% endif %}
+
+<script src="{{ STATIC_URL }}debug_toolbar/js/toolbar.sql.js"></script>