Build 0.5.2.
Showing
5 changed files
with
23 additions
and
10 deletions
... | @@ -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.5.1", | 5 | "version": "0.5.2", |
6 | "keywords": ["data binding", "templating"], | 6 | "keywords": ["data binding", "templating"], |
7 | "scripts": ["dist/rivets.js"], | 7 | "scripts": ["dist/rivets.js"], |
8 | "main": "dist/rivets.js", | 8 | "main": "dist/rivets.js", | ... | ... |
1 | // Rivets.js | 1 | // Rivets.js |
2 | // version: 0.5.1 | 2 | // version: 0.5.2 |
3 | // author: Michael Richards | 3 | // author: Michael Richards |
4 | // license: MIT | 4 | // license: MIT |
5 | (function() { | 5 | (function() { |
... | @@ -425,11 +425,11 @@ | ... | @@ -425,11 +425,11 @@ |
425 | })(); | 425 | })(); |
426 | 426 | ||
427 | Rivets.Util = { | 427 | Rivets.Util = { |
428 | bindEvent: function(el, event, handler, context) { | 428 | bindEvent: function(el, event, handler, view) { |
429 | var fn; | 429 | var fn; |
430 | 430 | ||
431 | fn = function(e) { | 431 | fn = function(ev) { |
432 | return handler.call(context, e); | 432 | return handler.call(this, ev, view); |
433 | }; | 433 | }; |
434 | if (window.jQuery != null) { | 434 | if (window.jQuery != null) { |
435 | el = jQuery(el); | 435 | el = jQuery(el); |
... | @@ -590,7 +590,7 @@ | ... | @@ -590,7 +590,7 @@ |
590 | if (this.currentListener) { | 590 | if (this.currentListener) { |
591 | Rivets.Util.unbindEvent(el, this.args[0], this.currentListener); | 591 | Rivets.Util.unbindEvent(el, this.args[0], this.currentListener); |
592 | } | 592 | } |
593 | return this.currentListener = Rivets.Util.bindEvent(el, this.args[0], value, this.model); | 593 | return this.currentListener = Rivets.Util.bindEvent(el, this.args[0], value, this.view); |
594 | } | 594 | } |
595 | }, | 595 | }, |
596 | "each-*": { | 596 | "each-*": { |
... | @@ -612,7 +612,7 @@ | ... | @@ -612,7 +612,7 @@ |
612 | } | 612 | } |
613 | }, | 613 | }, |
614 | routine: function(el, collection) { | 614 | routine: function(el, collection) { |
615 | var data, e, item, itemEl, m, n, previous, view, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3, _results; | 615 | var data, e, item, itemEl, k, m, n, options, previous, v, view, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3, _ref4, _results; |
616 | 616 | ||
617 | if (this.iterated != null) { | 617 | if (this.iterated != null) { |
618 | _ref = this.iterated; | 618 | _ref = this.iterated; |
... | @@ -645,7 +645,20 @@ | ... | @@ -645,7 +645,20 @@ |
645 | itemEl = el.cloneNode(true); | 645 | itemEl = el.cloneNode(true); |
646 | previous = this.iterated.length ? this.iterated[this.iterated.length - 1].els[0] : this.marker; | 646 | previous = this.iterated.length ? this.iterated[this.iterated.length - 1].els[0] : this.marker; |
647 | this.marker.parentNode.insertBefore(itemEl, (_ref3 = previous.nextSibling) != null ? _ref3 : null); | 647 | this.marker.parentNode.insertBefore(itemEl, (_ref3 = previous.nextSibling) != null ? _ref3 : null); |
648 | view = new Rivets.View(itemEl, data, this.view.options); | 648 | options = { |
649 | binders: this.view.options.binders, | ||
650 | formatters: this.view.options.binders, | ||
651 | config: {} | ||
652 | }; | ||
653 | if (this.view.options.config) { | ||
654 | _ref4 = this.view.options.config; | ||
655 | for (k in _ref4) { | ||
656 | v = _ref4[k]; | ||
657 | options.config[k] = v; | ||
658 | } | ||
659 | } | ||
660 | options.config.preloadData = true; | ||
661 | view = new Rivets.View(itemEl, data, options); | ||
649 | view.bind(); | 662 | view.bind(); |
650 | _results.push(this.iterated.push(view)); | 663 | _results.push(this.iterated.push(view)); |
651 | } | 664 | } | ... | ... |
This diff is collapsed.
Click to expand it.
1 | { | 1 | { |
2 | "name": "rivets", | 2 | "name": "rivets", |
3 | "description": "Declarative data binding facility.", | 3 | "description": "Declarative data binding facility.", |
4 | "version": "0.5.1", | 4 | "version": "0.5.2", |
5 | "author": "Michael Richards", | 5 | "author": "Michael Richards", |
6 | "url": "http://rivetsjs.com", | 6 | "url": "http://rivetsjs.com", |
7 | "main": "./dist/rivets.js", | 7 | "main": "./dist/rivets.js", | ... | ... |
-
Please register or sign in to post a comment