Switched handling of minimum event width to CSS
This commit is contained in:
1 parent
6565cf9cdb
commit
68d6154a5e
4 files changed
+5
-15
No files matched your search
@@ -39,6 +39,7 @@
|
|||||||
transition: width 0.6s ease;
|
transition: width 0.6s ease;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border-left: 1px solid #f5f5f5;
|
border-left: 1px solid #f5f5f5;
|
||||||
|
min-width: 2px;
|
||||||
}
|
}
|
||||||
#wpadminbar .laps-timeline .event-theme {
|
#wpadminbar .laps-timeline .event-theme {
|
||||||
background-color: #5cb85c;
|
background-color: #5cb85c;
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
.transition(width .6s ease);
|
.transition(width .6s ease);
|
||||||
position: absolute; // disable stacking at start
|
position: absolute; // disable stacking at start
|
||||||
border-left: 1px solid @timeline-bg;
|
border-left: 1px solid @timeline-bg;
|
||||||
|
min-width: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.laps-timeline .event-theme {
|
.laps-timeline .event-theme {
|
||||||
|
|||||||
+2
-14
@@ -252,15 +252,9 @@ class Laps {
|
|||||||
if ( $offset == $last_offset ) {
|
if ( $offset == $last_offset ) {
|
||||||
$key = count( $query_data ) - 1;
|
$key = count( $query_data ) - 1;
|
||||||
$query_data[$key]['sql'] .= '<br />' . $sql;
|
$query_data[$key]['sql'] .= '<br />' . $sql;
|
||||||
|
|
||||||
$last_duration += $duration;
|
$last_duration += $duration;
|
||||||
$width = round( $last_duration / $total * 100, 2 );
|
$width = round( $last_duration / $total * 100, 2 );
|
||||||
|
|
||||||
if ( 0 == $width ) {
|
|
||||||
$width = '2px';
|
|
||||||
} else {
|
|
||||||
$width .= '%';
|
|
||||||
}
|
|
||||||
|
|
||||||
$query_data[$key]['width'] = $width;
|
$query_data[$key]['width'] = $width;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@@ -270,12 +264,6 @@ class Laps {
|
|||||||
$last_offset = $offset;
|
$last_offset = $offset;
|
||||||
$last_duration = $duration;
|
$last_duration = $duration;
|
||||||
|
|
||||||
if ( 0 == $width ) {
|
|
||||||
$width = '2px';
|
|
||||||
} else {
|
|
||||||
$width .= '%';
|
|
||||||
}
|
|
||||||
|
|
||||||
$query_data[] = compact( 'sql', 'duration', 'offset', 'width', 'category' );
|
$query_data[] = compact( 'sql', 'duration', 'offset', 'width', 'category' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@
|
|||||||
{{#savequeries}}
|
{{#savequeries}}
|
||||||
<div class="laps-timeline">
|
<div class="laps-timeline">
|
||||||
{{#queries}}
|
{{#queries}}
|
||||||
<div class="event event-{{category}}" title="{{sql}}" style="width:{{width}}; left:{{offset}}%;"></div>
|
<div class="event event-{{category}}" title="{{sql}}" style="width:{{width}}%; left:{{offset}}%;"></div>
|
||||||
{{/queries}}
|
{{/queries}}
|
||||||
</div>
|
</div>
|
||||||
{{/savequeries}}
|
{{/savequeries}}
|
||||||
|
|||||||
Reference in new issue
Block a user