Skip to content

Commit

Permalink
Making it so that annotations are not shown, when Reel has velocity (…
Browse files Browse the repository at this point in the history
…when dragged & thrown). #36

For this the braking mechanism has been refactored to (1) fix bug when a very low velocity got occasinally sticked and hasn't been released and (2) simplify.
  • Loading branch information
pisi committed Dec 30, 2011
1 parent 97714a8 commit 8a1ebe4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions jquery.reel.js
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ jQuery.reel || (function($, window, document, undefined){
var
frame= frame || get(_frame_)
this.className= this.className.replace(frame_klass_pattern, frame_klass + frame);
$.each(get(_annotations_), function(ida, note){
if (!get(_velocity_)) $.each(get(_annotations_), function(ida, note){
var
$note= $(hash(ida)),
start= note.start || 1,
Expand Down Expand Up @@ -646,8 +646,7 @@ jQuery.reel || (function($, window, document, undefined){
velocity= get(_velocity_)
if (braking) var
braked= velocity - (get(_brake_) / leader(_tempo_) * braking),
done= velocity * braked <= 0 || velocity < abs(braked),
velocity= !done && set(_velocity_, velocity > abs(get(_speed_)) ? braked : (braking= operated= 0))
velocity= set(_velocity_, braked > 0.1 ? braked : (braking= operated= 0))
$monitor.text(get(opt.monitor));
velocity && braking++;
operated && operated++;
Expand Down

0 comments on commit 8a1ebe4

Please sign in to comment.