From b259f59f7b79973e3b404bc138db9ea213569e59 Mon Sep 17 00:00:00 2001 From: Andy Kant Date: Sun, 6 Jan 2013 19:13:09 -0600 Subject: [PATCH] Fixed issue where observable lists in Mustache were only live updating when the list's length changed instead of any changes. --- view/mustache/mustache.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/view/mustache/mustache.js b/view/mustache/mustache.js index 1fe8dd68b83..1c8529da036 100644 --- a/view/mustache/mustache.js +++ b/view/mustache/mustache.js @@ -652,8 +652,14 @@ function( can ){ case '#': // Iterate over arrays if (isArrayLike(name)) { + var isObserveList = isObserve(name); + + // Add the reference to the list in the contexts. for (i = 0; i < name.length; i++) { result.push(options.fn.call(name[i] || {}, context) || ''); + + // Ensure that live update works on observable lists + isObserveList && name.attr(''+i); } return result.join(''); }