Skip to content

Commit

Permalink
fix live slider update
Browse files Browse the repository at this point in the history
  • Loading branch information
tgdwyer committed Apr 23, 2014
1 parent 40c3e3a commit 418d68c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion WebCola/examples/ariel.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ <h1>Graph with variable link lengths</h1>
});
});

var lastValue = -1;

function changeData(v) {
if (v == lastValue) return;
lastValue = v;
var l = document.getElementById("sliderLabel");
l.textContent = dates[v];
var min = Number.MAX_VALUE, max = -Number.MAX_VALUE;
Expand Down Expand Up @@ -189,7 +193,7 @@ <h1>Graph with variable link lengths</h1>
}
</script>
<p>Flow for <label id="sliderLabel">0</label></p>
<input class="slider" id="dateSlider" type="range" min="0" max="47" value="0" onchange="changeData(this.value)" />
<input class="slider" id="dateSlider" type="range" min="0" max="47" value="0" onchange="changeData(this.value)" oninput="changeData(this.value)" />
<button onclick="showPositions()">Dump positions</button>
<ul>
<li>Slider changes the sample time.</li>
Expand Down

0 comments on commit 418d68c

Please sign in to comment.