diff --git a/server/templates/history.html b/server/templates/history.html index 71f4790..7a31935 100644 --- a/server/templates/history.html +++ b/server/templates/history.html @@ -67,7 +67,7 @@ data-tile-attrib="© OpenStreetMap contributors © CARTO" data-min-zoom="3" data-max-zoom="19"> diff --git a/static/js/history.js b/static/js/history.js index ac88296..c1013e6 100644 --- a/static/js/history.js +++ b/static/js/history.js @@ -168,8 +168,14 @@ } var ratio = st.maxIndex / (st.points.length - 1); var thumb = 16; // approximate range thumb width - var usable = Math.max(1, scrubber.clientWidth - thumb); - tick.style.left = (thumb / 2 + ratio * usable) + "px"; + var w = scrubber.clientWidth; + var usable = Math.max(1, w - thumb); + var x = thumb / 2 + ratio * usable; + // Keep the centered label inside the scrubber so it doesn't overlap the + // time (left) or speed (right) readouts when max speed is at an edge. + var halfLabel = 24; + x = Math.max(halfLabel, Math.min(w - halfLabel, x)); + tick.style.left = x + "px"; tick.hidden = false; } diff --git a/templates/history.html b/templates/history.html index 14cffbe..595a088 100644 --- a/templates/history.html +++ b/templates/history.html @@ -64,7 +64,7 @@