From 78825aa2195b89320e65e1b609dfcd8a9cddc595 Mon Sep 17 00:00:00 2001 From: Johannes Ewald Date: Fri, 7 Nov 2014 11:45:05 +0100 Subject: [PATCH] Use prototype inheritance in each-binder --- src/binders.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/binders.coffee b/src/binders.coffee index c4cab7b0d..82f61f6c1 100644 --- a/src/binders.coffee +++ b/src/binders.coffee @@ -189,12 +189,11 @@ Rivets.public.binders['each-*'] = @marker.parentNode.removeChild view.els[0] for model, index in collection - data = {index} + data = Object.create @view.models + data.index = index data[modelName] = model if not @iterated[index]? - for key, model of @view.models - data[key] ?= model previous = if @iterated.length @iterated[@iterated.length - 1].els[0]