Skip to content

Commit

Permalink
The "holder" can contain either an image defined by the image hash …
Browse files Browse the repository at this point in the history
…and/or a link defined by the `link` hash of the annotation member. It can also hold both - in that case the image is wrapped in the link. #36
  • Loading branch information
pisi committed Nov 9, 2011
1 parent 03849fd commit 9268aac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions jquery.reel.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,12 @@ jQuery.reel || (function($, window, document, undefined){
|| ($annotations= $());
$.each(opt.annotations, function(ida, note){
var
$note= $(_div_tag_, note.holder).attr({ id: ida })
$note= $(_div_tag_, note.holder).attr({ id: ida }),
$image= note.image ? $(tag(_img_), note.image) : $(),
$link= note.link ? $(tag(_a_), note.link) : $()
note.image || note.link && $note.append($link);
note.link || note.image && $note.append($image);
note.link && note.image && $note.append($link.append($image));
$note.appendTo($annotations);
});
}
Expand Down Expand Up @@ -812,7 +817,7 @@ jQuery.reel || (function($, window, document, undefined){
_touchend_= 'touchend'+ns, _touchstart_= 'touchstart'+ns, _touchmove_= 'touchmove'+ns,

// Various string primitives
__= '', ___= ' ', _absolute_= 'absolute', _div_= 'div', _div_tag_= tag(_div_),
__= '', ___= ' ', _absolute_= 'absolute', _a_= 'a', _div_= 'div', _div_tag_= tag(_div_),
_height_= 'height', _hex_black_= '#000', _id_= 'id', _img_= 'img', _px_= 'px', _src_= 'src',
_title_= 'title', _width_= 'width'

Expand Down

0 comments on commit 9268aac

Please sign in to comment.