Skip to content

Commit 3209c8e

Browse files
committed
Fix incompatibility with jQuery 2.
Fix #463.
1 parent 3e95e53 commit 3209c8e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

debug_toolbar/static/debug_toolbar/js/toolbar.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
init: function() {
1717
$('#djDebug').show();
1818
var current = null;
19-
$('#djDebugPanelList li a').live('click', function() {
19+
$(document).on('click', '#djDebugPanelList li a', function() {
2020
if (!this.className) {
2121
return false;
2222
}
@@ -51,20 +51,20 @@
5151
}
5252
return false;
5353
});
54-
$('#djDebug a.djDebugClose').live('click', function() {
54+
$(document).on('click', '#djDebug a.djDebugClose', function() {
5555
$(document).trigger('close.djDebug');
5656
$('#djDebugToolbar li').removeClass('active');
5757
return false;
5858
});
59-
$('#djDebug .djDebugPanelButton input[type=checkbox]').live('click', function() {
59+
$(document).on('click', '#djDebug .djDebugPanelButton input[type=checkbox]', function() {
6060
$.cookie($(this).attr('data-cookie'), $(this).prop('checked') ? 'on' : 'off', {
6161
path: '/',
6262
expires: 10,
6363
});
6464
});
6565

6666
// Used by the SQL and template panels
67-
$('#djDebug .remoteCall').live('click', function() {
67+
$(document).on('click', '#djDebug .remoteCall', function() {
6868
var self = $(this);
6969
var name = self[0].tagName.toLowerCase();
7070
var ajax_data = {};
@@ -90,7 +90,7 @@
9090
$('#djDebugWindow').html(message).show();
9191
});
9292

93-
$('#djDebugWindow a.djDebugBack').live('click', function() {
93+
$(document).on('click', '#djDebugWindow a.djDebugBack', function() {
9494
$(this).parent().parent().hide();
9595
return false;
9696
});
@@ -99,7 +99,7 @@
9999
});
100100

101101
// Used by the cache, profiling and SQL panels
102-
$('#djDebug a.djToggleSwitch').live('click', function(e) {
102+
$(document).on('click', '#djDebug a.djToggleSwitch', function(e) {
103103
e.preventDefault();
104104
var btn = $(this);
105105
var id = btn.attr('data-toggle-id');

0 commit comments

Comments
 (0)