temple-backbone
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -5,3 +5,3 @@ /* | ||
* MIT License | ||
* Version 1.1.0 | ||
* Version 1.1.1 | ||
*/ | ||
@@ -105,3 +105,3 @@ | ||
// remove old models | ||
if (diff.length) { | ||
if (diff.length) { | ||
diff.forEach(function(m) { | ||
@@ -112,3 +112,3 @@ model.unset(m.cid); | ||
for (var i = 0; i < diff.length; i++) { | ||
for (var i = diff.length - 1; i >= 0; i--) { | ||
model.unset((models.length + i).toString()); | ||
@@ -123,5 +123,3 @@ } | ||
isLeaf: function() { return false; }, | ||
toArray: function() { | ||
return this.target.toArray(); | ||
}, | ||
isArray: function() { return true; }, | ||
get: function(path) { | ||
@@ -128,0 +126,0 @@ return CollectionProxy.get(this.target, path); |
@@ -1,1 +0,1 @@ | ||
!function(a,b){"use strict";if("undefined"!=typeof module&&module.exports&&"function"==typeof require)b(require("temple-mustache"),require("backbone"));else if("function"==typeof define&&define.amd)define(["temple-mustache","backbone"],b);else{if(!a.Mustache||!a.Backbone)throw new Error("Could not find Temple Mustache or Backbone!");b(a.Mustache,a.Backbone)}}("undefined"!=typeof window?window:this,function(a,b){a.registerPlugin("backbone",function(){this.registerProxy(c),this.registerProxy(d)});var c=a.Proxy.extend({constructor:function(a,b){this.target=a,this.model=b,this.target.on("change",this._onChange=function(){for(var a in this.changed)b.set(a,this.changed[a],{reset:!0})})},isLeaf:function(){return!1},get:function(a){return c.get(this.target,a)},set:function(a,b){return this.target.set(a,b),!0},keys:function(){return this.target.keys()},unset:function(a){return this.target.unset(a),!0},merge:function(b){return a.util.isPlainObject(b)?(this.target.set(b),!0):!1},destroy:function(){this.target.off("change",this._onChange)}},{match:function(a){return a instanceof b.Model},get:function(a,b){return a.get(b)}}),d=a.Proxy.extend({constructor:function(a,b){this.target=a,this.model=b;var c=a.toArray();this.set("length",a.length),this.listenTo(a,"add remove sort reset",function(){var d=a.toArray();d.forEach(function(a,c){b.set(c.toString(),a),b.set(a.cid,a),null!=a.id&&b.set(a.id,a)});var e=c.filter(function(a){return d.indexOf(a)<0});if(e.length){e.forEach(function(a){b.unset(a.cid),null!=a.id&&b.unset(a.id)});for(var f=0;f<e.length;f++)b.unset((d.length+f).toString())}c=d,b.set("length",a.length)})},isLeaf:function(){return!1},toArray:function(){return this.target.toArray()},get:function(a){return d.get(this.target,a)},set:function(){return!0},keys:function(){return Object.keys(this.target.toArray())},unset:function(){return!0},merge:function(){return!1},destroy:function(){this.stopListening(this.target)}},{match:function(a){return a instanceof b.Collection},get:function(a,b){return"length"===b?a.length:a.at(b)||a.get(b)}})}); | ||
!function(a,b){"use strict";if("undefined"!=typeof module&&module.exports&&"function"==typeof require)b(require("temple-mustache"),require("backbone"));else if("function"==typeof define&&define.amd)define(["temple-mustache","backbone"],b);else{if(!a.Mustache||!a.Backbone)throw new Error("Could not find Temple Mustache or Backbone!");b(a.Mustache,a.Backbone)}}("undefined"!=typeof window?window:this,function(a,b){a.registerPlugin("backbone",function(){this.registerProxy(c),this.registerProxy(d)});var c=a.Proxy.extend({constructor:function(a,b){this.target=a,this.model=b,this.target.on("change",this._onChange=function(){for(var a in this.changed)b.set(a,this.changed[a],{reset:!0})})},isLeaf:function(){return!1},get:function(a){return c.get(this.target,a)},set:function(a,b){return this.target.set(a,b),!0},keys:function(){return this.target.keys()},unset:function(a){return this.target.unset(a),!0},merge:function(b){return a.util.isPlainObject(b)?(this.target.set(b),!0):!1},destroy:function(){this.target.off("change",this._onChange)}},{match:function(a){return a instanceof b.Model},get:function(a,b){return a.get(b)}}),d=a.Proxy.extend({constructor:function(a,b){this.target=a,this.model=b;var c=a.toArray();this.set("length",a.length),this.listenTo(a,"add remove sort reset",function(){var d=a.toArray();d.forEach(function(a,c){b.set(c.toString(),a),b.set(a.cid,a),null!=a.id&&b.set(a.id,a)});var e=c.filter(function(a){return d.indexOf(a)<0});if(e.length){e.forEach(function(a){b.unset(a.cid),null!=a.id&&b.unset(a.id)});for(var f=e.length-1;f>=0;f--)b.unset((d.length+f).toString())}c=d,b.set("length",a.length)})},isLeaf:function(){return!1},isArray:function(){return!0},get:function(a){return d.get(this.target,a)},set:function(){return!0},keys:function(){return Object.keys(this.target.toArray())},unset:function(){return!0},merge:function(){return!1},destroy:function(){this.stopListening(this.target)}},{match:function(a){return a instanceof b.Collection},get:function(a,b){return"length"===b?a.length:a.at(b)||a.get(b)}})}); |
@@ -97,3 +97,3 @@ (function ( global, factory ) { | ||
// remove old models | ||
if (diff.length) { | ||
if (diff.length) { | ||
diff.forEach(function(m) { | ||
@@ -104,3 +104,3 @@ model.unset(m.cid); | ||
for (var i = 0; i < diff.length; i++) { | ||
for (var i = diff.length - 1; i >= 0; i--) { | ||
model.unset((models.length + i).toString()); | ||
@@ -115,5 +115,3 @@ } | ||
isLeaf: function() { return false; }, | ||
toArray: function() { | ||
return this.target.toArray(); | ||
}, | ||
isArray: function() { return true; }, | ||
get: function(path) { | ||
@@ -120,0 +118,0 @@ return CollectionProxy.get(this.target, path); |
{ | ||
"name": "temple-backbone", | ||
"description": "Adds Backbone specific handlers to Temple.", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"author": "Beneath the Ink <info@beneaththeink.com>", | ||
@@ -19,5 +19,5 @@ "contributors": [ | ||
"devDependencies": { | ||
"browserify": "4.1.5", | ||
"browserify": "5.11.2", | ||
"grunt": "0.4.5", | ||
"grunt-contrib-uglify": "0.4.0", | ||
"grunt-contrib-uglify": "0.5.1", | ||
"grunt-wrap2000": "0.1.0" | ||
@@ -24,0 +24,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
644948
20632