Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
handle undefined options in toss
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbender committed Oct 30, 2013
1 parent 463c9b2 commit 18b6479
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/overthrow-toss.js
Expand Up @@ -39,13 +39,11 @@
top: "+0",
left: "+0",
duration: 50,
easing: o.easing
easing: o.easing,
finished: function() {}
},
endLeft, endTop, finished = false;

// use a no-op for the finished callback
options.finished = options.finished || function() {};

// Mixin based on predefined defaults
if( options ){
for( var j in op ){
Expand Down Expand Up @@ -90,7 +88,7 @@
// we know that we're done here call the callback
// otherwise signal that horizontal scrolling is complete
if( finished ) {
options.finished();
op.finished();
}
finished = true;
}
Expand All @@ -101,7 +99,7 @@
// if the end of the horizontal scrolling has taken place
// we know that we're done here call the callback
if( finished ) {
options.finished();
op.finished();
}
finished = true;
}
Expand Down

0 comments on commit 18b6479

Please sign in to comment.