Remove references to the exported module. Use the properties available on Rivets…
… instead. [Closes #146]
Showing
1 changed file
with
9 additions
and
5 deletions
... | @@ -339,7 +339,7 @@ Rivets.binders = | ... | @@ -339,7 +339,7 @@ Rivets.binders = |
339 | "each-*": | 339 | "each-*": |
340 | block: true | 340 | block: true |
341 | bind: (el, collection) -> | 341 | bind: (el, collection) -> |
342 | el.removeAttribute ['data', rivets.config.prefix, @type].join('-').replace '--', '-' | 342 | el.removeAttribute ['data', Rivets.config.prefix, @type].join('-').replace '--', '-' |
343 | routine: (el, collection) -> | 343 | routine: (el, collection) -> |
344 | if @iterated? | 344 | if @iterated? |
345 | for view in @iterated | 345 | for view in @iterated |
... | @@ -358,12 +358,16 @@ Rivets.binders = | ... | @@ -358,12 +358,16 @@ Rivets.binders = |
358 | data[n] = m for n, m of @view.models | 358 | data[n] = m for n, m of @view.models |
359 | data[@args[0]] = item | 359 | data[@args[0]] = item |
360 | itemEl = el.cloneNode true | 360 | itemEl = el.cloneNode true |
361 | if @iterated.length > 0 | 361 | |
362 | previous = @iterated[@iterated.length - 1].els[0] | 362 | previous = if @iterated.length |
363 | @iterated[@iterated.length - 1].els[0] | ||
363 | else | 364 | else |
364 | previous = @marker | 365 | @marker |
366 | |||
365 | @marker.parentNode.insertBefore itemEl, previous.nextSibling ? null | 367 | @marker.parentNode.insertBefore itemEl, previous.nextSibling ? null |
366 | @iterated.push rivets.bind itemEl, data | 368 | view = new Rivets.View(itemEl, data) |
369 | view.bind() | ||
370 | @iterated.push view | ||
367 | 371 | ||
368 | "class-*": (el, value) -> | 372 | "class-*": (el, value) -> |
369 | elClass = " #{el.className} " | 373 | elClass = " #{el.className} " | ... | ... |
-
Please register or sign in to post a comment