Skip to content

Commit 2036b19

Browse files
committed
Fix some jquery deprecation warnings
Ths is a follow-on PR to #241 in order to fix the deprecation warnings: * `bind()` replaced by `on()` * `click(handler)` replaced by `on('click', handler)` Three deprecation warnings remain, but they are caused by the `jquery.tablesorter.js` plugin, so need to be handled upstream: * Mottie/tablesorter#1787 * Mottie/tablesorter#1786 Related: * #166
1 parent 969cce5 commit 2036b19

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/flask_debugtoolbar/static/js/toolbar.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
init: function() {
88
$('#flDebug').show();
99
var current = null;
10-
$('#flDebugPanelList li a').click(function() {
10+
$('#flDebugPanelList li a').on('click', function() {
1111
if (!this.className) {
1212
return false;
1313
}
@@ -23,7 +23,7 @@
2323
}
2424
return false;
2525
});
26-
$('#flDebugPanelList li .flDebugSwitch').click(function() {
26+
$('#flDebugPanelList li .flDebugSwitch').on('click', function() {
2727
var $panel = $(this).parent();
2828
var $this = $(this);
2929
var dom_id = $panel.attr('id');
@@ -52,12 +52,12 @@
5252
});
5353
}
5454
});
55-
$('#flDebug a.flDebugClose').click(function() {
55+
$('#flDebug a.flDebugClose').on('click', function() {
5656
$(document).trigger('close.flDebug');
5757
$('#flDebugToolbar li').removeClass('flDebugActive');
5858
return false;
5959
});
60-
$('#flDebug a.flDebugRemoteCall').click(function() {
60+
$('#flDebug a.flDebugRemoteCall').on('click', function() {
6161
$('#flDebugWindow').load(this.href, {}, function() {
6262
$('#flDebugWindow a.flDebugBack').click(function() {
6363
$(this).parent().parent().hide();
@@ -67,24 +67,24 @@
6767
$('#flDebugWindow').show();
6868
return false;
6969
});
70-
$('#flDebugTemplatePanel a.flDebugTemplateShowContext').click(function() {
70+
$('#flDebugTemplatePanel a.flDebugTemplateShowContext').on('click', function() {
7171
fldt.toggle_arrow($(this).children('.flDebugToggleArrow'))
7272
fldt.toggle_content($(this).parent().next());
7373
return false;
7474
});
75-
$('#flDebugSQLPanel a.flDebugShowStacktrace').click(function() {
75+
$('#flDebugSQLPanel a.flDebugShowStacktrace').on('click', function() {
7676
fldt.toggle_content($('.flDebugHideStacktraceDiv', $(this).parents('tr')));
7777
return false;
7878
});
79-
$('#flDebugHideToolBarButton').click(function() {
79+
$('#flDebugHideToolBarButton').on('click', function() {
8080
fldt.hide_toolbar(true);
8181
return false;
8282
});
83-
$('#flDebugShowToolBarButton').click(function() {
83+
$('#flDebugShowToolBarButton').on('click', function() {
8484
fldt.show_toolbar();
8585
return false;
8686
});
87-
$(document).bind('close.flDebug', function() {
87+
$(document).on('close.flDebug', function() {
8888
// If a sub-panel is open, close that
8989
if ($('#flDebugWindow').is(':visible')) {
9090
$('#flDebugWindow').hide();
@@ -153,7 +153,7 @@
153153
},
154154
show_toolbar: function(animate) {
155155
// Set up keybindings
156-
$(document).bind('keydown.flDebug', function(e) {
156+
$(document).on('keydown.flDebug', function(e) {
157157
if (e.keyCode == 27) {
158158
fldt.close();
159159
}

0 commit comments

Comments
 (0)