From 284748adb7fae0e7fa246cff9e90623be518a719 Mon Sep 17 00:00:00 2001 From: John McLear Date: Wed, 6 Feb 2013 23:35:58 +0000 Subject: [PATCH] stop slider showing NaN on tiny pads --- src/static/js/broadcast_slider.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/static/js/broadcast_slider.js b/src/static/js/broadcast_slider.js index 08ac08b5a..5acaedaff 100644 --- a/src/static/js/broadcast_slider.js +++ b/src/static/js/broadcast_slider.js @@ -108,11 +108,15 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) newpos = Number(newpos); if (newpos < 0 || newpos > sliderLength) return; window.location.hash = "#" + newpos; + if(!newpos){ + newpos = 0; // stops it from displaying NaN if newpos isn't set + } $("#ui-slider-handle").css('left', newpos * ($("#ui-slider-bar").width() - 2) / (sliderLength * 1.0)); $("a.tlink").map(function() { $(this).attr('href', $(this).attr('thref').replace("%revision%", newpos)); }); + console.log(newpos); $("#revision_label").html(html10n.get("timeslider.version", { "version": newpos})); if (newpos == 0)