Skip to content

Commit

Permalink
Opting for a different solution of center data test. Rather than fi…
Browse files Browse the repository at this point in the history
…xing the test (which was wrong, I know), I fixed the data value (now that's better) to not only evaluate as Boolean, but to really be a Boolean. Closes GH-33.
  • Loading branch information
pisi committed May 8, 2011
1 parent 9757aee commit 089f9f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion jquery.reel.js
Expand Up @@ -197,6 +197,7 @@ jQuery.reel || (function($, window, document, undefined){
set(_cwish_, negative_when(1, !opt.cw && !stitched));
set(_reeling_, false);
set(_brake_, opt.brake);
set(_center_, !!opt.orbital);
set(_tempo_, opt.tempo / ($.reel.lazy? opt.laziness : 1));
set(_opening_ticks_, 0);
set(_backup_, {
Expand Down Expand Up @@ -525,7 +526,7 @@ jQuery.reel || (function($, window, document, undefined){
was= get(_frame_),
frame= set(_frame_, 1 + floor(fraction / get(_bit_))),
orbital= opt.orbital,
center= set(_center_, orbital && (frame <= orbital || frame >= opt.footage - orbital + 2))
center= set(_center_, !!orbital && (frame <= orbital || frame >= opt.footage - orbital + 2))
if (!opt.loops && opt.rebound) var
edgy= !operated && !(fraction % 1) ? on_edge++ : (on_edge= 0),
bounce= on_edge >= opt.rebound * 1000 / leader(_tempo_),
Expand Down
2 changes: 1 addition & 1 deletion test/unit/data.js
Expand Up @@ -24,7 +24,7 @@
ok( is('Boolean', $reel.data('backwards')), '`backwards` Boolean');
ok( is('Number', $reel.data('bit')), '`bit` Number');
ok( is('Number', $reel.data('brake')), '`brake` Number');
ok( is('Boolean', !!$reel.data('center')), '`center` evaluates as Boolean');
ok( is('Boolean', $reel.data('center')), '`center` Boolean');
ok( is('String', $reel.data('classes')), '`classes` String');
ok( is('Number', $reel.data('cwish')), '`cwish` Number');
ok( is('Object', $reel.data('dimensions')), '`dimensions` Object');
Expand Down

0 comments on commit 089f9f8

Please sign in to comment.