Merge pull request #1461 from ether/slider-nan

stop slider showing NaN on tiny pads
pull/1464/head
John McLear 2013-02-06 15:45:39 -08:00
commit e78879c300
1 changed files with 4 additions and 0 deletions

View File

@ -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)