Skip to content

Commit

Permalink
TVB-2372 Fix time display in the slider when time selection is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
kimonoki committed Aug 9, 2018
1 parent a0de3d2 commit 9f22515
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,12 @@ function _initSliders() {
$('#TimeNow').val(currentTimeValue);
},
change: function () {
triggered_by_timeselection = false;
if (timeselection_interval!=0){
triggered_by_timeselection = false;
tsView.timeselection_move_fn();
triggered_by_timeselection = true;
}

},
stop: function (event, target) {
sliderSel = false;
Expand Down Expand Up @@ -1126,9 +1129,9 @@ function tick() {
lastTime = timeNow;
if (timeData.length > 0 && !AG_isStopped) {
//syncing time with the d3 plot
if (tsView.viewer_type() === 'dualbrain') {
//add dt because the 2d will add one step after the slider changes
document.getElementById("TimeNow").value = (timeselection[0]+tsView.dt()).toFixed(2);
//add dt because the 2d will add one step after the slider changes
if (timeselection[0]>0) {
document.getElementById("TimeNow").value = (timeselection[0] + tsView.dt()).toFixed(2);
}
else {
document.getElementById("TimeNow").value = toSignificantDigits(timeData[currentTimeValue], 2);
Expand Down

0 comments on commit 9f22515

Please sign in to comment.