aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/media/toolbar.js
diff options
context:
space:
mode:
Diffstat (limited to 'debug_toolbar/media/toolbar.js')
-rw-r--r--debug_toolbar/media/toolbar.js44
1 files changed, 10 insertions, 34 deletions
diff --git a/debug_toolbar/media/toolbar.js b/debug_toolbar/media/toolbar.js
index 9cbda92..c69a917 100644
--- a/debug_toolbar/media/toolbar.js
+++ b/debug_toolbar/media/toolbar.js
@@ -9,6 +9,9 @@ jQuery(function() {
init: function() {
var current = null;
$j('#djDebugPanelList li a').click(function() {
+ if (!this.className) {
+ return false;
+ }
current = $j('#djDebug #' + this.className);
if (current.is(':visible')) {
$j(document).trigger('close.djDebug');
@@ -35,20 +38,25 @@ jQuery(function() {
});
$j('#djDebugTemplatePanel a.djTemplateShowContext').click(function() {
$j.djDebug.toggle_content($j(this).parent().next());
+ return false;
+ });
+ $j('#djDebugSQLPanel a.djSQLShowStacktrace').click(function() {
+ $j.djDebug.toggle_content($j(this).parent().next());
+ return false;
});
$j('#djHideToolBarButton').click(function() {
$j.djDebug.hide_toolbar(true);
+ return false;
});
$j('#djShowToolBarButton').click(function() {
$j.djDebug.show_toolbar();
+ return false;
});
if ($j.cookie(COOKIE_NAME)) {
$j.djDebug.hide_toolbar(false);
} else {
$j('#djDebugToolbar').show();
}
- $j(window).load($j.djDebug.format_panels);
- $j(window).resize($j.djDebug.format_panels);
},
open: function() {
$j(document).bind('keydown.djDebug', function(e) {
@@ -85,37 +93,6 @@ jQuery(function() {
path: '/',
expires: -1
});
- },
- /* Make sure that panel layout doesn't overflow the screen
- * width. Any panel that would otherwise wrap to the next line
- * are pushed into a "more..." vertical display in the final
- * panel position. */
- format_panels: function () {
- // If we've already done some overflow-avoidance, undo the
- // effect before recomputing (needed, for example, after a
- // window resize).
- $j("#djDebugMore > ul > li").appendTo("#djDebugPanelList");
- $j("#djDebugMore").remove();
-
- // Check for wrapping by examing the position of the last
- // element.
- var row_top = $j("#djDebugPanelList > li").position().top;
- var final_pos = $j("#djDebugPanelList > li:last").position();
-
- if (final_pos.top == row_top && final_pos.left != 0) {
- return;
- }
-
- function overflow_check(idx) {
- pos = $j(this).position();
- return pos.top > row_top || (idx > 1 && pos.left == 0);
- };
-
- var more = $j("<li id='djDebugMore'>More...<ul></ul></li>");
- more.prependTo("#djDebugPanelList");
- overflows = $j("#djDebugPanelList > li").filter(overflow_check);
- more.appendTo("#djDebugPanelList");
- $j("#djDebugMore > ul").append(overflows);
}
});
$j(document).bind('close.djDebug', function() {
@@ -126,6 +103,5 @@ jQuery(function() {
jQuery(function() {
jQuery.djDebug();
});
-
$ = _$;