diff --git a/css/laps.css b/css/laps.css
index 6a10e11..11b3075 100644
--- a/css/laps.css
+++ b/css/laps.css
@@ -39,6 +39,7 @@
transition: width 0.6s ease;
position: absolute;
border-left: 1px solid #f5f5f5;
+ min-width: 2px;
}
#wpadminbar .laps-timeline .event-theme {
background-color: #5cb85c;
diff --git a/css/laps.less b/css/laps.less
index c56650c..388be0d 100644
--- a/css/laps.less
+++ b/css/laps.less
@@ -51,6 +51,7 @@
.transition(width .6s ease);
position: absolute; // disable stacking at start
border-left: 1px solid @timeline-bg;
+ min-width: 2px;
}
.laps-timeline .event-theme {
diff --git a/src/class-laps.php b/src/class-laps.php
index 738f4c3..0613fb0 100644
--- a/src/class-laps.php
+++ b/src/class-laps.php
@@ -252,15 +252,9 @@ class Laps {
if ( $offset == $last_offset ) {
$key = count( $query_data ) - 1;
$query_data[$key]['sql'] .= '
' . $sql;
+
$last_duration += $duration;
- $width = round( $last_duration / $total * 100, 2 );
-
- if ( 0 == $width ) {
- $width = '2px';
- } else {
- $width .= '%';
- }
-
+ $width = round( $last_duration / $total * 100, 2 );
$query_data[$key]['width'] = $width;
continue;
@@ -270,12 +264,6 @@ class Laps {
$last_offset = $offset;
$last_duration = $duration;
- if ( 0 == $width ) {
- $width = '2px';
- } else {
- $width .= '%';
- }
-
$query_data[] = compact( 'sql', 'duration', 'offset', 'width', 'category' );
}
}
diff --git a/views/laps.mustache b/views/laps.mustache
index 93e1bef..5c51e97 100644
--- a/views/laps.mustache
+++ b/views/laps.mustache
@@ -7,7 +7,7 @@
{{#savequeries}}