8c6c5364 by Carl-Johan Blomqvist

Fix Issue #158

Children of iterated elements should always get initiated straight away
- it doesn't make sense to not have them iniate since you'll otherwise
basically get a lot of copies of the content inside
1 parent 421bf22b
...@@ -397,7 +397,15 @@ Rivets.binders = ...@@ -397,7 +397,15 @@ Rivets.binders =
397 @marker 397 @marker
398 398
399 @marker.parentNode.insertBefore itemEl, previous.nextSibling ? null 399 @marker.parentNode.insertBefore itemEl, previous.nextSibling ? null
400 view = new Rivets.View(itemEl, data, @view.options) 400 options =
401 binders: @view.options.binders
402 formatters: @view.options.binders
403 config: {}
404 options.config[k] = v for k, v of @view.options.config if @view.options.config
405 # Ensure preloadData is set to true since child elements won't get initiated otherwise until the next change (which might not be the first)
406 options.config.preloadData = true
407
408 view = new Rivets.View(itemEl, data, options)
401 view.bind() 409 view.bind()
402 @iterated.push view 410 @iterated.push view
403 411
......