5cd20248 by Michael Richards

Build 0.4.5.

1 parent 14b3c772
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 "name": "rivets", 2 "name": "rivets",
3 "repo": "mikeric/rivets", 3 "repo": "mikeric/rivets",
4 "description": "Declarative data binding facility.", 4 "description": "Declarative data binding facility.",
5 "version": "0.4.4", 5 "version": "0.4.5",
6 "keywords": ["data binding", "template"], 6 "keywords": ["data binding", "template"],
7 "scripts": ["lib/rivets.js"], 7 "scripts": ["lib/rivets.js"],
8 "main": "lib/rivets.js", 8 "main": "lib/rivets.js",
......
1 // rivets.js 1 // rivets.js
2 // version: 0.4.4 2 // version: 0.4.5
3 // author: Michael Richards 3 // author: Michael Richards
4 // license: MIT 4 // license: MIT
5 (function() { 5 (function() {
...@@ -535,22 +535,28 @@ ...@@ -535,22 +535,28 @@
535 el.parentNode.removeChild(el); 535 el.parentNode.removeChild(el);
536 } 536 }
537 this.iterated = []; 537 this.iterated = [];
538 _results = []; 538 if (collection) {
539 for (_k = 0, _len2 = collection.length; _k < _len2; _k++) { 539 _results = [];
540 item = collection[_k]; 540 for (_k = 0, _len2 = collection.length; _k < _len2; _k++) {
541 data = {}; 541 item = collection[_k];
542 _ref2 = this.view.models; 542 data = {};
543 for (n in _ref2) { 543 _ref2 = this.view.models;
544 m = _ref2[n]; 544 for (n in _ref2) {
545 data[n] = m; 545 m = _ref2[n];
546 data[n] = m;
547 }
548 data[this.args[0]] = item;
549 itemEl = el.cloneNode(true);
550 if (this.iterated.length > 0) {
551 previous = this.iterated[this.iterated.length - 1].els[0];
552 } else {
553 previous = this.marker;
554 }
555 this.marker.parentNode.insertBefore(itemEl, (_ref3 = previous.nextSibling) != null ? _ref3 : null);
556 _results.push(this.iterated.push(rivets.bind(itemEl, data)));
546 } 557 }
547 data[this.args[0]] = item; 558 return _results;
548 itemEl = el.cloneNode(true);
549 previous = this.iterated[this.iterated.length - 1] || this.marker;
550 this.marker.parentNode.insertBefore(itemEl, (_ref3 = previous.nextSibling) != null ? _ref3 : null);
551 _results.push(this.iterated.push(rivets.bind(itemEl, data)));
552 } 559 }
553 return _results;
554 } 560 }
555 }, 561 },
556 "class-*": function(el, value) { 562 "class-*": function(el, value) {
......
1 { 1 {
2 "name" : "rivets", 2 "name" : "rivets",
3 "description" : "Declarative data binding facility.", 3 "description" : "Declarative data binding facility.",
4 "version" : "0.4.4", 4 "version" : "0.4.5",
5 "author" : "Michael Richards", 5 "author" : "Michael Richards",
6 "url" : "http://rivetsjs.com", 6 "url" : "http://rivetsjs.com",
7 "main" : "./lib/rivets.js", 7 "main" : "./lib/rivets.js",
......
1 # rivets.js 1 # rivets.js
2 # version : 0.4.4 2 # version : 0.4.5
3 # author : Michael Richards 3 # author : Michael Richards
4 # license : MIT 4 # license : MIT
5 5
......