Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #1 from theron17/master
Browse files Browse the repository at this point in the history
Compare function animation duration not matching listed duration
  • Loading branch information
LeaVerou committed Dec 15, 2011
2 parents 22fb790 + 85d6ad1 commit 7863012
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions interaction.js
Expand Up @@ -77,7 +77,9 @@ var self = window.bezierLibrary = {
this.bezierCanvas.plot(self.thumbnailStyleSelected);

compare.style.cssText = this.style.cssText;


compare.style.setProperty(prefix + 'transition-duration', getDuration() + 's', null);

compareCanvas.bezier = this.bezier;

compareCanvas.plot({
Expand Down Expand Up @@ -283,16 +285,10 @@ go.onclick = function() {
};

duration.oninput = function() {
var value = Math.round(this.value * 10) / 10;

if(isNaN(value)) {
return;
}

this.nextElementSibling.textContent = value + ' second' + (value == 1? '' : 's');

current.style.setProperty(prefix + 'transition-duration', value + 's', null);
compare.style.setProperty(prefix + 'transition-duration', value + 's', null);
var val = getDuration();
this.nextElementSibling.textContent = val + ' second' + (val == 1? '' : 's');
current.style.setProperty(prefix + 'transition-duration', val + 's', null);
compare.style.setProperty(prefix + 'transition-duration', val + 's', null);
};

window['import'].onclick = function() {
Expand Down Expand Up @@ -357,6 +353,10 @@ importexport.onsubmit = function() {
* Helper functions
*/

function getDuration() {
return (isNaN(val = Math.round(duration.value * 10) / 10)) ? null : val;
}

function update() {
// Redraw canvas
bezierCanvas.bezier =
Expand Down

0 comments on commit 7863012

Please sign in to comment.