Skip to content

Commit 06a80d8

Browse files
author
Steven Surowiec
committed
Added ability to click on tabs when the profiler is hidden
1 parent 2a9d560 commit 06a80d8

File tree

2 files changed

+28
-21
lines changed

2 files changed

+28
-21
lines changed

resources/profiler.css

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212

1313
/* ----- IDS ----- */
1414
#profiler-container { z-index: 9999; }
15-
#profiler-metrics{ background: #000; width:100%; }
15+
#profiler-metrics { background: #000; width: 100%; }
1616
#profiler-console,
1717
#profiler-speed,
1818
#profiler-queries,
1919
#profiler-memory,
20-
#profiler-files{ background: url(../images/pqp/overlay.gif); border-top: 1px solid #ccc; height: 200px; overflow: auto; }
20+
#profiler-file { background: url(../images/pqp/overlay.gif); border-top: 1px solid #ccc; height: 200px; overflow: auto; }
2121

2222
/* ----- Logic ----- */
2323
#profiler,
@@ -39,17 +39,17 @@
3939
.profiler .memory #profiler-memory,
4040
.profiler .files #profiler-files { display: block; }
4141

42-
.console td#console,
43-
.speed td#speed,
44-
.queries td#queries,
45-
.memory td#memory,
46-
.files td#files { background: #222 !important; border-bottom: 6px solid #fff !important; cursor: default !important; }
42+
.console td#console.active,
43+
.speed td#speed.active,
44+
.queries td#queries.active,
45+
.memory td#memory.active,
46+
.files td#files.active { background: #222 !important; border-bottom: 6px solid #fff !important; cursor: default !important; }
4747

4848
.tallDetails #profiler .profiler-box { height: 500px; }
4949
.tallDetails #profiler .profiler-box h3 { line-height: 500px; }
50-
.hideDetails #profiler .profiler-box { display: none !important; }
50+
.hideDetails #profiler .profiler-box { display: none; }
5151
.hideDetails #profiler-footer { border-top: 1px dotted #444; }
52-
.hideDetails #profiler #profiler-metrics td { height: 50px; background: #000 !important; border-bottom: none !important; cursor: default !important; }
52+
.hideDetails #profiler #profiler-metrics td { height: 50px; }
5353
.hideDetails #profiler var { font-size: 18px; margin: 0 0 2px 0; }
5454
.hideDetails #profiler h4 { font-size: 10px; }
5555
.hideDetails .heightToggle{ visibility: hidden; }

resources/profiler.js

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
(function($) {
2-
var PQP_DETAILS = false;
3-
var PQP_HEIGHT = 'short';
4-
var PROFILER_DETAILS = false;
2+
var profiler_details = false;
53

64
function hideAllTabs() {
75
$('#profiler').removeClass('console')
@@ -12,7 +10,7 @@
1210
}
1311

1412
$(document).ready(function() {
15-
setTimeout(function() { $('#profiler-container').css('display', 'block') }, 10);
13+
setTimeout(function() { $('#profiler-container').css('display', 'block') }, 10);
1614

1715
$('.query-profile H4').css('cursor', 'pointer').click(function() {
1816
if ($('table', $(this).parent()).is(':hidden')) {
@@ -25,28 +23,37 @@
2523
});
2624

2725
$('.detailsToggle').click(function() {
28-
if (PQP_DETAILS) {
26+
if (profiler_details) {
2927
$('#profiler-container').addClass('hideDetails');
30-
PQP_DETAILS = false;
28+
profiler_details = false;
3129
} else {
32-
$('#profiler-container').removeClass('hideDetails');
33-
PQP_DETAILS = true;
30+
$('#profiler-container').removeClass('hideDetails');
31+
profiler_details = true;
3432
}
33+
3534
return false;
3635
});
3736

3837
$('.heightToggle').click(function() {
39-
var container = $('#pqp-container');
38+
var container = $('#profiler-container');
4039

41-
if (container.hasClass('tallDetails'))
40+
if (container.hasClass('tallDetails')) {
4241
container.removeClass('tallDetails');
43-
else
42+
} else {
4443
container.addClass('tallDetails');
44+
}
4545
});
4646

47-
$('.tab').click(function() {
47+
$('.tab').css('cursor', 'pointer').click(function() {
4848
hideAllTabs();
49+
50+
$(this).addClass('active');
4951
$('#profiler').addClass($(this).attr('id'));
52+
53+
if (!profiler_details) {
54+
profiler_details = true;
55+
$('#profiler-container').removeClass('hideDetails');
56+
}
5057
});
5158
});
5259
})(jQuery);

0 commit comments

Comments
 (0)