Skip to content

Commit

Permalink
And just like image's data-images can accept an array string, so do…
Browse files Browse the repository at this point in the history
…es `data-x` and `data-y` attributes of annotations. With an addition of number conversion. #190
  • Loading branch information
pisi committed May 20, 2013
1 parent 9f49d0a commit 3a1b2c2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions jquery.reel.js
Expand Up @@ -1894,6 +1894,14 @@ jQuery.reel || (function($, window, document, undefined){
var
$annotation= $(annotation),
def= $annotation.data(),
x= def.x,
x_array= reel.re.array.exec(x),
xs= def.x= !x_array ? x : x.split(reel.re.array),
xs= $.each(def.x, function(ix, it){ def.x[ix]= it ? +it : undefined }),
y= def.y,
y_array= reel.re.array.exec(y),
ys= def.y= !y_array ? y : y.split(reel.re.array),
ys= $.each(def.y, function(ix, it){ def.y[ix]= it ? +it : undefined }),
id= $annotation.attr(_id_),
node= def.node= $annotation.removeData()
annotations[id] = def;
Expand Down

0 comments on commit 3a1b2c2

Please sign in to comment.