Skip to content

Commit

Permalink
Fixed issue where observable lists in Mustache were only live updatin…
Browse files Browse the repository at this point in the history
…g when the list's length changed instead of any changes.
  • Loading branch information
andykant committed Jan 7, 2013
1 parent 19e086c commit b259f59
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions view/mustache/mustache.js
Expand Up @@ -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('');
}
Expand Down

0 comments on commit b259f59

Please sign in to comment.