|
7 | 7 | isReady: false, |
8 | 8 | init: function() { |
9 | 9 | $('#djDebug').show(); |
10 | | - $('#djDebugPanelList').on('click', 'li a', function() { |
| 10 | + $('#djDebugPanelList').on('click', 'li a', function(event) { |
| 11 | + event.preventDefault(); |
11 | 12 | if (!this.className) { |
12 | | - return false; |
| 13 | + return; |
13 | 14 | } |
14 | 15 | var current = $('#djDebug #' + this.className); |
15 | 16 | if (current.is(':visible')) { |
|
40 | 41 | $('#djDebugToolbar li').removeClass('djdt-active'); |
41 | 42 | $(this).parent().addClass('djdt-active'); |
42 | 43 | } |
43 | | - return false; |
44 | 44 | }); |
45 | | - $('#djDebug').on('click', 'a.djDebugClose', function() { |
| 45 | + $('#djDebug').on('click', 'a.djDebugClose', function(event) { |
| 46 | + event.preventDefault(); |
46 | 47 | $(document).trigger('close.djDebug'); |
47 | 48 | $('#djDebugToolbar li').removeClass('djdt-active'); |
48 | | - return false; |
49 | 49 | }); |
50 | 50 | $('#djDebug').on('click', '.djDebugPanelButton input[type=checkbox]', function() { |
51 | 51 | djdt.cookie.set($(this).attr('data-cookie'), $(this).prop('checked') ? 'on' : 'off', { |
|
55 | 55 | }); |
56 | 56 |
|
57 | 57 | // Used by the SQL and template panels |
58 | | - $('#djDebug').on('click', '.remoteCall', function() { |
| 58 | + $('#djDebug').on('click', '.remoteCall', function(event) { |
| 59 | + event.preventDefault(); |
| 60 | + |
59 | 61 | var self = $(this); |
60 | 62 | var name = self[0].tagName.toLowerCase(); |
61 | 63 | var ajax_data = {}; |
|
81 | 83 | $('#djDebugWindow').html(message).show(); |
82 | 84 | }); |
83 | 85 |
|
84 | | - $('#djDebugWindow').on('click', 'a.djDebugBack', function() { |
| 86 | + $('#djDebugWindow').on('click', 'a.djDebugBack', function(event) { |
| 87 | + event.preventDefault(); |
85 | 88 | $(this).parent().parent().hide(); |
86 | | - return false; |
87 | 89 | }); |
88 | | - |
89 | | - return false; |
90 | 90 | }); |
91 | 91 |
|
92 | 92 | // Used by the cache, profiling and SQL panels |
93 | | - $('#djDebug').on('click', 'a.djToggleSwitch', function(e) { |
94 | | - e.preventDefault(); |
| 93 | + $('#djDebug').on('click', 'a.djToggleSwitch', function(event) { |
| 94 | + event.preventDefault(); |
95 | 95 | var btn = $(this); |
96 | 96 | var id = btn.attr('data-toggle-id'); |
97 | 97 | var open_me = btn.text() == btn.attr('data-toggle-open'); |
|
115 | 115 | $this.find('.djToggleSwitch').text(btn.text()); |
116 | 116 | } |
117 | 117 | }); |
118 | | - return; |
119 | 118 | }); |
120 | 119 |
|
121 | | - $('#djHideToolBarButton').click(function() { |
| 120 | + $('#djHideToolBarButton').on('click', function(event) { |
| 121 | + event.preventDefault(); |
122 | 122 | djdt.hide_toolbar(true); |
123 | | - return false; |
124 | 123 | }); |
125 | | - $('#djShowToolBarButton').click(function() { |
| 124 | + $('#djShowToolBarButton').on('click', function(event) { |
| 125 | + event.preventDefault(); |
126 | 126 | if (!djdt.handleDragged) { |
127 | 127 | djdt.show_toolbar(); |
128 | 128 | } |
129 | | - return false; |
130 | 129 | }); |
131 | 130 | var handle = $('#djDebugToolbarHandle'); |
132 | 131 | $('#djShowToolBarButton').on('mousedown', function (event) { |
| 132 | + event.preventDefault(); |
133 | 133 | var startPageY = event.pageY; |
134 | 134 | var baseY = handle.offset().top - startPageY; |
135 | 135 | var windowHeight = $(window).height(); |
|
150 | 150 | djdt.handleDragged = true; |
151 | 151 | } |
152 | 152 | }); |
153 | | - return false; |
154 | 153 | }); |
155 | | - $(document).on('mouseup', function () { |
| 154 | + $(document).on('mouseup', function (event) { |
156 | 155 | $(document).off('mousemove.djDebug'); |
157 | 156 | if (djdt.handleDragged) { |
| 157 | + event.preventDefault(); |
158 | 158 | var top = handle.offset().top - window.pageYOffset; |
159 | 159 | djdt.cookie.set('djdttop', top, { |
160 | 160 | path: '/', |
|
163 | 163 | setTimeout(function () { |
164 | 164 | djdt.handleDragged = false; |
165 | 165 | }, 10); |
166 | | - return false; |
167 | 166 | } |
168 | 167 | }); |
169 | | - $(document).bind('close.djDebug', function() { |
| 168 | + $(document).on('close.djDebug', function() { |
170 | 169 | // If a sub-panel is open, close that |
171 | 170 | if ($('#djDebugWindow').is(':visible')) { |
172 | 171 | $('#djDebugWindow').hide(); |
|
189 | 188 | } else { |
190 | 189 | djdt.show_toolbar(false); |
191 | 190 | } |
192 | | - $('#djDebug .djDebugHoverable').hover(function(){ |
| 191 | + $('#djDebug .djDebugHoverable').on('hover', function(){ |
193 | 192 | $(this).addClass('djDebugHover'); |
194 | 193 | }, function(){ |
195 | 194 | $(this).removeClass('djDebugHover'); |
|
220 | 219 | handle.css({top: handleTop + 'px'}); |
221 | 220 | } |
222 | 221 | // Unbind keydown |
223 | | - $(document).unbind('keydown.djDebug'); |
| 222 | + $(document).off('keydown.djDebug'); |
224 | 223 | if (setCookie) { |
225 | 224 | djdt.cookie.set('djdt', 'hide', { |
226 | 225 | path: '/', |
|
230 | 229 | }, |
231 | 230 | show_toolbar: function(animate) { |
232 | 231 | // Set up keybindings |
233 | | - $(document).bind('keydown.djDebug', function(e) { |
| 232 | + $(document).on('keydown.djDebug', function(e) { |
234 | 233 | if (e.keyCode == 27) { |
235 | 234 | djdt.close(); |
236 | 235 | } |
|
0 commit comments