Skip to content

Commit

Permalink
When no annotations are defined, events in the .annotations names…
Browse files Browse the repository at this point in the history
…pace get unbinded completely #36

For that we also needed to re-reference the `$overlay`, which is quite mysteriously broken after the wraping application.
  • Loading branch information
pisi committed Nov 26, 2011
1 parent 3bee6c5 commit 4b0f3a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jquery.reel.js
Expand Up @@ -176,8 +176,9 @@ jQuery.reel || (function($, window, document, undefined){
stage_id= '#'+id+opt.suffix,
classes= t.attr('class') || '',
$overlay= $(_div_tag_, { id: stage_id.substr(1), 'class': classes+___+overlay_klass }).bind('openingDone', delay_play),
$instance= t.wrap($overlay.bind(on.instance)).attr({ 'class': klass }),
instances_count= instances.push(add_instance($instance)[0])
$instance= t.wrap($overlay).attr({ 'class': klass }),
instances_count= instances.push(add_instance($instance)[0]),
$overlay= $instance.parent().bind(on.instance)
set(_image_, images.length && images.length || opt.image || src.replace(/^(.*)\.(jpg|jpeg|png|gif)$/, '$1' + opt.suffix + '.$2'));
set(_images_, []);
set(_frame_, opt.frame);
Expand Down Expand Up @@ -208,6 +209,7 @@ jQuery.reel || (function($, window, document, undefined){
style: styles || __,
data: data
});
opt.annotations || $overlay.unbind('.annotations');
rule(true, '', { width: size.x, height: size.y });
rule(true, ','+___+dot(klass), { display: 'block', position: 'relative' });
pool.bind(on.pool);
Expand Down Expand Up @@ -597,7 +599,6 @@ jQuery.reel || (function($, window, document, undefined){
},

'setup.annotations': function(e){
if (!opt.annotations) return;
var
space= get(_dimensions_),
$overlay= t.parent(),
Expand All @@ -619,7 +620,6 @@ jQuery.reel || (function($, window, document, undefined){
});
},
'frameChange.annotations': function(e, frame){
if (!opt.annotations) return;
var
frame= frame || get(_frame_)
$annotations[0].className= $annotations[0].className.replace(/frame-\d+/g, frame_klass + frame);
Expand Down

0 comments on commit 4b0f3a1

Please sign in to comment.