Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

built

  • Loading branch information...
commit 2fe245dd95841cad94cbb2334a3be5e78ed24ab3 1 parent 49fdd32
@hunterloftis authored
View
4 dist/backbone.viewmodel-0.2.0.js
@@ -621,9 +621,9 @@
this.container.html('');
this.collection = this.viewModel.get(this.attr);
if (this.collection instanceof Backbone.Collection) {
- this.collection.off('add remove reset change create sort', this.onCollectionChange);
+ this.collection.off('add remove reset create sort', this.onCollectionChange);
this.collection.each(this.renderItem);
- return this.collection.on('add remove reset change create sort', this.onCollectionChange);
+ return this.collection.on('add remove reset create sort', this.onCollectionChange);
} else {
_ref = this.collection;
_results = [];
View
4 dist/backbone.viewmodel-0.2.0.min.js
@@ -19,6 +19,6 @@ $(this.node).show():$(this.node).hide()};return a}(b.Binding);b.Binding.text=fun
function(){a.__super__.start.apply(this,arguments);return $(this.node).on("keyup change",this.onViewChange)};a.prototype.onModelChange=function(){var a;a=this.viewModel.get(this.attribute);return $(this.node).val(a)};a.prototype.onViewChange=function(){return this.viewModel.set(this.attribute,$(this.node).val())};a.prototype.stop=function(){a.__super__.stop.apply(this,arguments);return $(this.node).off("keyup change",this.onViewChange)};return a}(b.Binding);b.Binding.css=function(b){function a(){return a.__super__.constructor.apply(this,
arguments)}f(a,b);a.prototype.initialize=function(a,b,c){this.className=a;this.attribute=b;this.truth=null!=c?c:!0};a.prototype.onModelChange=function(){var a;a=this.viewModel.get(this.attribute);return Boolean(this.truth)===Boolean(a)?$(this.node).addClass(this.className):$(this.node).removeClass(this.className)};return a}(b.Binding);b.Binding.click=function(b){function a(){return a.__super__.constructor.apply(this,arguments)}f(a,b);a.prototype.initialize=function(){var a;a=_.toArray(arguments);
this.callback=a.shift();return this.args=a};a.prototype.start=function(){return $(this.node).on("click",this.onViewChange)};a.prototype.onViewChange=function(a){var b;a.preventDefault();return(null!=(b=this.viewModel[this.callback])?b:this.viewModel.get(this.callback)).apply(this.viewModel,this.args)};a.prototype.stop=function(){return $(this.node).off("click",this.onViewChange)};return a}(b.Binding);return b.Binding.each=function(c){function a(){this.renderItem=d(this.renderItem,this);return a.__super__.constructor.apply(this,
-arguments)}f(a,c);a.prototype.initialize=function(a){this.attr=a;this.container=$(this.node);this.itemTemplate=this.container.html();return this.container.html("")};a.prototype.start=function(){this.viewModel.on("change:"+this.attr,this.onCollectionChange);return this.onCollectionChange()};a.prototype.onCollectionChange=function(){var a,c,d,f,g;this.container.html("");this.collection=this.viewModel.get(this.attr);if(this.collection instanceof b.Collection)return this.collection.off("add remove reset change create sort",
-this.onCollectionChange),this.collection.each(this.renderItem),this.collection.on("add remove reset change create sort",this.onCollectionChange);f=this.collection;g=[];c=0;for(d=f.length;c<d;c++)a=f[c],g.push(this.renderItem(a));return g};a.prototype.renderItem=function(a){var b,c,d,f,g;f=$(this.itemTemplate);g=[];c=0;for(d=f.length;c<d;c++)b=f[c],this.container.append(b),g.push(a.bindView(this.bindingAttr,b));return g};a.prototype.stop=function(){return this.viewModel.off("change:"+this.attr,this.onCollectionChange)};
+arguments)}f(a,c);a.prototype.initialize=function(a){this.attr=a;this.container=$(this.node);this.itemTemplate=this.container.html();return this.container.html("")};a.prototype.start=function(){this.viewModel.on("change:"+this.attr,this.onCollectionChange);return this.onCollectionChange()};a.prototype.onCollectionChange=function(){var a,c,d,f,g;this.container.html("");this.collection=this.viewModel.get(this.attr);if(this.collection instanceof b.Collection)return this.collection.off("add remove reset create sort",
+this.onCollectionChange),this.collection.each(this.renderItem),this.collection.on("add remove reset create sort",this.onCollectionChange);f=this.collection;g=[];c=0;for(d=f.length;c<d;c++)a=f[c],g.push(this.renderItem(a));return g};a.prototype.renderItem=function(a){var b,c,d,f,g;f=$(this.itemTemplate);g=[];c=0;for(d=f.length;c<d;c++)b=f[c],this.container.append(b),g.push(a.bindView(this.bindingAttr,b));return g};a.prototype.stop=function(){return this.viewModel.off("change:"+this.attr,this.onCollectionChange)};
return a}(b.Binding)})(Backbone)}).call(this);
View
4 lib/bindings.js
@@ -174,9 +174,9 @@
this.container.html('');
this.collection = this.viewModel.get(this.attr);
if (this.collection instanceof Backbone.Collection) {
- this.collection.off('add remove reset change create sort', this.onCollectionChange);
+ this.collection.off('add remove reset create sort', this.onCollectionChange);
this.collection.each(this.renderItem);
- return this.collection.on('add remove reset change create sort', this.onCollectionChange);
+ return this.collection.on('add remove reset create sort', this.onCollectionChange);
} else {
_ref = this.collection;
_results = [];
Please sign in to comment.
Something went wrong with that request. Please try again.