Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

backbone.babysitter

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backbone.babysitter - npm Package Compare versions

Comparing version 0.0.6 to 0.1.0

component.json

9

CHANGELOG.md
# Change log
### v0.1.0
* allow chaining of add and remove methods
* add component.json
#### General
* update grunt file
* readme fixed
* fix gruntfile url
### v0.0.6

@@ -4,0 +13,0 @@

2

Gruntfile.js

@@ -17,3 +17,3 @@ /*global module:false*/

'//\n' +
'// http://github.com/babysitterjs/backbone.babysitter\n' +
'// http://github.com/marionettejs/backbone.babysitter\n' +
'\n'

@@ -20,0 +20,0 @@ },

// Backbone.BabySitter
// -------------------
// v0.0.6
// v0.1.0
//
// Copyright (c)2013 Derick Bailey, Muted Solutions, LLC.
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
//
// http://github.com/babysitterjs/backbone.babysitter
// http://github.com/marionettejs/backbone.babysitter

@@ -72,2 +72,3 @@ (function (root, factory) {

this._updateLength();
return this;
},

@@ -101,3 +102,3 @@

// retrieve a view by it's `cid` directly
// retrieve a view by its `cid` directly
findByCid: function(cid){

@@ -129,2 +130,3 @@ return this._views[cid];

this._updateLength();
return this;
},

@@ -131,0 +133,0 @@

// Backbone.BabySitter
// -------------------
// v0.0.6
// v0.1.0
//
// Copyright (c)2013 Derick Bailey, Muted Solutions, LLC.
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
//
// http://github.com/babysitterjs/backbone.babysitter
// http://github.com/marionettejs/backbone.babysitter
(function(i,e){if("object"==typeof exports){var t=require("underscore"),n=require("backbone");module.exports=e(t,n)}else"function"==typeof define&&define.amd&&define(["underscore","backbone"],e)})(this,function(i,e){"option strict";return e.ChildViewContainer=function(i,e){var t=function(i){this._views={},this._indexByModel={},this._indexByCustom={},this._updateLength(),e.each(i,this.add,this)};e.extend(t.prototype,{add:function(i,e){var t=i.cid;this._views[t]=i,i.model&&(this._indexByModel[i.model.cid]=t),e&&(this._indexByCustom[e]=t),this._updateLength()},findByModel:function(i){return this.findByModelCid(i.cid)},findByModelCid:function(i){var e=this._indexByModel[i];return this.findByCid(e)},findByCustom:function(i){var e=this._indexByCustom[i];return this.findByCid(e)},findByIndex:function(i){return e.values(this._views)[i]},findByCid:function(i){return this._views[i]},remove:function(i){var t=i.cid;i.model&&delete this._indexByModel[i.model.cid],e.any(this._indexByCustom,function(i,e){return i===t?(delete this._indexByCustom[e],!0):void 0},this),delete this._views[t],this._updateLength()},call:function(i){this.apply(i,e.tail(arguments))},apply:function(i,t){e.each(this._views,function(n){e.isFunction(n[i])&&n[i].apply(n,t||[])})},_updateLength:function(){this.length=e.size(this._views)}});var n=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return e.each(n,function(i){t.prototype[i]=function(){var t=e.values(this._views),n=[t].concat(e.toArray(arguments));return e[i].apply(e,n)}}),t}(e,i),e.ChildViewContainer});
(function(i,e){if("object"==typeof exports){var t=require("underscore"),n=require("backbone");module.exports=e(t,n)}else"function"==typeof define&&define.amd&&define(["underscore","backbone"],e)})(this,function(i,e){"option strict";return e.ChildViewContainer=function(i,e){var t=function(i){this._views={},this._indexByModel={},this._indexByCustom={},this._updateLength(),e.each(i,this.add,this)};e.extend(t.prototype,{add:function(i,e){var t=i.cid;return this._views[t]=i,i.model&&(this._indexByModel[i.model.cid]=t),e&&(this._indexByCustom[e]=t),this._updateLength(),this},findByModel:function(i){return this.findByModelCid(i.cid)},findByModelCid:function(i){var e=this._indexByModel[i];return this.findByCid(e)},findByCustom:function(i){var e=this._indexByCustom[i];return this.findByCid(e)},findByIndex:function(i){return e.values(this._views)[i]},findByCid:function(i){return this._views[i]},remove:function(i){var t=i.cid;return i.model&&delete this._indexByModel[i.model.cid],e.any(this._indexByCustom,function(i,e){return i===t?(delete this._indexByCustom[e],!0):void 0},this),delete this._views[t],this._updateLength(),this},call:function(i){this.apply(i,e.tail(arguments))},apply:function(i,t){e.each(this._views,function(n){e.isFunction(n[i])&&n[i].apply(n,t||[])})},_updateLength:function(){this.length=e.size(this._views)}});var n=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return e.each(n,function(i){t.prototype[i]=function(){var t=e.values(this._views),n=[t].concat(e.toArray(arguments));return e[i].apply(e,n)}}),t}(e,i),e.ChildViewContainer});
// Backbone.BabySitter
// -------------------
// v0.0.6
// v0.1.0
//
// Copyright (c)2013 Derick Bailey, Muted Solutions, LLC.
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
//
// http://github.com/babysitterjs/backbone.babysitter
// http://github.com/marionettejs/backbone.babysitter

@@ -56,2 +56,3 @@ // Backbone.ChildViewContainer

this._updateLength();
return this;
},

@@ -85,3 +86,3 @@

// retrieve a view by it's `cid` directly
// retrieve a view by its `cid` directly
findByCid: function(cid){

@@ -113,2 +114,3 @@ return this._views[cid];

this._updateLength();
return this;
},

@@ -115,0 +117,0 @@

// Backbone.BabySitter
// -------------------
// v0.0.6
// v0.1.0
//
// Copyright (c)2013 Derick Bailey, Muted Solutions, LLC.
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
//
// http://github.com/babysitterjs/backbone.babysitter
// http://github.com/marionettejs/backbone.babysitter
Backbone.ChildViewContainer=function(i,t){var e=function(i){this._views={},this._indexByModel={},this._indexByCustom={},this._updateLength(),t.each(i,this.add,this)};t.extend(e.prototype,{add:function(i,t){var e=i.cid;this._views[e]=i,i.model&&(this._indexByModel[i.model.cid]=e),t&&(this._indexByCustom[t]=e),this._updateLength()},findByModel:function(i){return this.findByModelCid(i.cid)},findByModelCid:function(i){var t=this._indexByModel[i];return this.findByCid(t)},findByCustom:function(i){var t=this._indexByCustom[i];return this.findByCid(t)},findByIndex:function(i){return t.values(this._views)[i]},findByCid:function(i){return this._views[i]},remove:function(i){var e=i.cid;i.model&&delete this._indexByModel[i.model.cid],t.any(this._indexByCustom,function(i,t){return i===e?(delete this._indexByCustom[t],!0):void 0},this),delete this._views[e],this._updateLength()},call:function(i){this.apply(i,t.tail(arguments))},apply:function(i,e){t.each(this._views,function(n){t.isFunction(n[i])&&n[i].apply(n,e||[])})},_updateLength:function(){this.length=t.size(this._views)}});var n=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return t.each(n,function(i){e.prototype[i]=function(){var e=t.values(this._views),n=[e].concat(t.toArray(arguments));return t[i].apply(t,n)}}),e}(Backbone,_);
Backbone.ChildViewContainer=function(i,t){var e=function(i){this._views={},this._indexByModel={},this._indexByCustom={},this._updateLength(),t.each(i,this.add,this)};t.extend(e.prototype,{add:function(i,t){var e=i.cid;return this._views[e]=i,i.model&&(this._indexByModel[i.model.cid]=e),t&&(this._indexByCustom[t]=e),this._updateLength(),this},findByModel:function(i){return this.findByModelCid(i.cid)},findByModelCid:function(i){var t=this._indexByModel[i];return this.findByCid(t)},findByCustom:function(i){var t=this._indexByCustom[i];return this.findByCid(t)},findByIndex:function(i){return t.values(this._views)[i]},findByCid:function(i){return this._views[i]},remove:function(i){var e=i.cid;return i.model&&delete this._indexByModel[i.model.cid],t.any(this._indexByCustom,function(i,t){return i===e?(delete this._indexByCustom[t],!0):void 0},this),delete this._views[e],this._updateLength(),this},call:function(i){this.apply(i,t.tail(arguments))},apply:function(i,e){t.each(this._views,function(n){t.isFunction(n[i])&&n[i].apply(n,e||[])})},_updateLength:function(){this.length=t.size(this._views)}});var n=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return t.each(n,function(i){e.prototype[i]=function(){var e=t.values(this._views),n=[e].concat(t.toArray(arguments));return t[i].apply(t,n)}}),e}(Backbone,_);
//@ sourceMappingURL=backbone.babysitter.map
{
"name": "backbone.babysitter",
"description": "Manage child views in a Backbone.View",
"version": "0.0.6",
"version": "0.1.0",
"homepage": "https://github.com/marionettejs/backbone.babysitter",

@@ -6,0 +6,0 @@ "main": "lib/amd/backbone.babysitter.js",

@@ -56,3 +56,3 @@ # Backbone.BabySitter

When adding a view, you can optionally specify a custom index key
When adding a view, you can optionally specify a custom index key
by which you can later retrieve the view.

@@ -162,4 +162,4 @@

To get the number of stored views, call the `container.length`
attribute. This attribute is updated any time a view is added or
To get the number of stored views, call the `container.length`
attribute. This attribute is updated any time a view is added or
removed.

@@ -222,3 +222,3 @@

container.each(function(view){
// process each view individually, here

@@ -239,1 +239,7 @@

MIT - see [LICENSE.md](https://github.com/marionettejs/backbone.babysitter/blob/master/LICENSE.md)
## Dev
* `npm install`
* `npm install -g grunt-cli`
* `grunt`

@@ -1,1 +0,1 @@

{"./src/amd.js":{"path":"./src/amd.js","s":{"1":1,"2":1,"3":0,"4":0,"5":0,"6":1,"7":0,"8":0,"9":0},"b":{"1":[0,1],"2":[0,1],"3":[1,0]},"f":{"1":1,"2":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":26}}},"2":{"name":"(anonymous_2)","line":14,"loc":{"start":{"line":14,"column":8},"end":{"line":14,"column":31}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":20,"column":4}},"2":{"start":{"line":2,"column":2},"end":{"line":13,"column":3}},"3":{"start":{"line":4,"column":4},"end":{"line":4,"column":43}},"4":{"start":{"line":5,"column":4},"end":{"line":5,"column":39}},"5":{"start":{"line":7,"column":4},"end":{"line":7,"column":51}},"6":{"start":{"line":9,"column":9},"end":{"line":13,"column":3}},"7":{"start":{"line":11,"column":4},"end":{"line":11,"column":48}},"8":{"start":{"line":15,"column":2},"end":{"line":15,"column":18}},"9":{"start":{"line":18,"column":2},"end":{"line":18,"column":37}}},"branchMap":{"1":{"line":2,"type":"if","locations":[{"start":{"line":2,"column":2},"end":{"line":2,"column":2}},{"start":{"line":2,"column":2},"end":{"line":2,"column":2}}]},"2":{"line":9,"type":"if","locations":[{"start":{"line":9,"column":9},"end":{"line":9,"column":9}},{"start":{"line":9,"column":9},"end":{"line":9,"column":9}}]},"3":{"line":9,"type":"binary-expr","locations":[{"start":{"line":9,"column":13},"end":{"line":9,"column":41}},{"start":{"line":9,"column":45},"end":{"line":9,"column":55}}]}}},"./src/childviewcontainer.js":{"path":"./src/childviewcontainer.js","s":{"1":1,"2":1,"3":17,"4":17,"5":17,"6":17,"7":17,"8":1,"9":24,"10":24,"11":24,"12":5,"13":24,"14":7,"15":24,"16":2,"17":2,"18":2,"19":2,"20":2,"21":3,"22":8,"23":4,"24":4,"25":4,"26":4,"27":4,"28":4,"29":4,"30":4,"31":4,"32":3,"33":5,"34":10,"35":9,"36":45,"37":1,"38":1,"39":23,"40":2,"41":2,"42":2,"43":1},"b":{"1":[5,19],"2":[7,17],"3":[4,0],"4":[4,0],"5":[9,1],"6":[9,0]},"f":{"1":1,"2":17,"3":24,"4":2,"5":2,"6":2,"7":3,"8":8,"9":4,"10":4,"11":3,"12":5,"13":10,"14":45,"15":23,"16":2},"fnMap":{"1":{"name":"(anonymous_1)","line":7,"loc":{"start":{"line":7,"column":31},"end":{"line":7,"column":52}}},"2":{"name":"(anonymous_2)","line":12,"loc":{"start":{"line":12,"column":18},"end":{"line":12,"column":33}}},"3":{"name":"(anonymous_3)","line":30,"loc":{"start":{"line":30,"column":9},"end":{"line":30,"column":36}}},"4":{"name":"(anonymous_4)","line":51,"loc":{"start":{"line":51,"column":17},"end":{"line":51,"column":32}}},"5":{"name":"(anonymous_5)","line":58,"loc":{"start":{"line":58,"column":20},"end":{"line":58,"column":38}}},"6":{"name":"(anonymous_6)","line":64,"loc":{"start":{"line":64,"column":18},"end":{"line":64,"column":33}}},"7":{"name":"(anonymous_7)","line":71,"loc":{"start":{"line":71,"column":17},"end":{"line":71,"column":32}}},"8":{"name":"(anonymous_8)","line":76,"loc":{"start":{"line":76,"column":15},"end":{"line":76,"column":28}}},"9":{"name":"(anonymous_9)","line":81,"loc":{"start":{"line":81,"column":12},"end":{"line":81,"column":26}}},"10":{"name":"(anonymous_10)","line":90,"loc":{"start":{"line":90,"column":33},"end":{"line":90,"column":52}}},"11":{"name":"(anonymous_11)","line":107,"loc":{"start":{"line":107,"column":10},"end":{"line":107,"column":26}}},"12":{"name":"(anonymous_12)","line":114,"loc":{"start":{"line":114,"column":11},"end":{"line":114,"column":33}}},"13":{"name":"(anonymous_13)","line":115,"loc":{"start":{"line":115,"column":26},"end":{"line":115,"column":40}}},"14":{"name":"(anonymous_14)","line":123,"loc":{"start":{"line":123,"column":19},"end":{"line":123,"column":29}}},"15":{"name":"(anonymous_15)","line":138,"loc":{"start":{"line":138,"column":18},"end":{"line":138,"column":35}}},"16":{"name":"(anonymous_16)","line":139,"loc":{"start":{"line":139,"column":34},"end":{"line":139,"column":45}}}},"statementMap":{"1":{"start":{"line":7,"column":0},"end":{"line":148,"column":16}},"2":{"start":{"line":12,"column":2},"end":{"line":19,"column":4}},"3":{"start":{"line":13,"column":4},"end":{"line":13,"column":21}},"4":{"start":{"line":14,"column":4},"end":{"line":14,"column":28}},"5":{"start":{"line":15,"column":4},"end":{"line":15,"column":29}},"6":{"start":{"line":16,"column":4},"end":{"line":16,"column":25}},"7":{"start":{"line":18,"column":4},"end":{"line":18,"column":34}},"8":{"start":{"line":24,"column":2},"end":{"line":126,"column":5}},"9":{"start":{"line":31,"column":6},"end":{"line":31,"column":29}},"10":{"start":{"line":34,"column":6},"end":{"line":34,"column":34}},"11":{"start":{"line":37,"column":6},"end":{"line":39,"column":7}},"12":{"start":{"line":38,"column":8},"end":{"line":38,"column":53}},"13":{"start":{"line":42,"column":6},"end":{"line":44,"column":7}},"14":{"start":{"line":43,"column":8},"end":{"line":43,"column":51}},"15":{"start":{"line":46,"column":6},"end":{"line":46,"column":27}},"16":{"start":{"line":52,"column":6},"end":{"line":52,"column":44}},"17":{"start":{"line":59,"column":6},"end":{"line":59,"column":49}},"18":{"start":{"line":60,"column":6},"end":{"line":60,"column":37}},"19":{"start":{"line":65,"column":6},"end":{"line":65,"column":47}},"20":{"start":{"line":66,"column":6},"end":{"line":66,"column":37}},"21":{"start":{"line":72,"column":6},"end":{"line":72,"column":42}},"22":{"start":{"line":77,"column":6},"end":{"line":77,"column":30}},"23":{"start":{"line":82,"column":6},"end":{"line":82,"column":29}},"24":{"start":{"line":85,"column":6},"end":{"line":87,"column":7}},"25":{"start":{"line":86,"column":8},"end":{"line":86,"column":50}},"26":{"start":{"line":90,"column":6},"end":{"line":95,"column":15}},"27":{"start":{"line":91,"column":8},"end":{"line":94,"column":9}},"28":{"start":{"line":92,"column":10},"end":{"line":92,"column":42}},"29":{"start":{"line":93,"column":10},"end":{"line":93,"column":22}},"30":{"start":{"line":98,"column":6},"end":{"line":98,"column":34}},"31":{"start":{"line":101,"column":6},"end":{"line":101,"column":27}},"32":{"start":{"line":108,"column":6},"end":{"line":108,"column":44}},"33":{"start":{"line":115,"column":6},"end":{"line":119,"column":9}},"34":{"start":{"line":116,"column":8},"end":{"line":118,"column":9}},"35":{"start":{"line":117,"column":10},"end":{"line":117,"column":47}},"36":{"start":{"line":124,"column":6},"end":{"line":124,"column":40}},"37":{"start":{"line":133,"column":2},"end":{"line":136,"column":43}},"38":{"start":{"line":138,"column":2},"end":{"line":144,"column":5}},"39":{"start":{"line":139,"column":4},"end":{"line":143,"column":6}},"40":{"start":{"line":140,"column":6},"end":{"line":140,"column":40}},"41":{"start":{"line":141,"column":6},"end":{"line":141,"column":54}},"42":{"start":{"line":142,"column":6},"end":{"line":142,"column":38}},"43":{"start":{"line":147,"column":2},"end":{"line":147,"column":19}}},"branchMap":{"1":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":6},"end":{"line":37,"column":6}},{"start":{"line":37,"column":6},"end":{"line":37,"column":6}}]},"2":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":6},"end":{"line":42,"column":6}},{"start":{"line":42,"column":6},"end":{"line":42,"column":6}}]},"3":{"line":85,"type":"if","locations":[{"start":{"line":85,"column":6},"end":{"line":85,"column":6}},{"start":{"line":85,"column":6},"end":{"line":85,"column":6}}]},"4":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":8},"end":{"line":91,"column":8}},{"start":{"line":91,"column":8},"end":{"line":91,"column":8}}]},"5":{"line":116,"type":"if","locations":[{"start":{"line":116,"column":8},"end":{"line":116,"column":8}},{"start":{"line":116,"column":8},"end":{"line":116,"column":8}}]},"6":{"line":117,"type":"binary-expr","locations":[{"start":{"line":117,"column":35},"end":{"line":117,"column":39}},{"start":{"line":117,"column":43},"end":{"line":117,"column":45}}]}}}}
{"./src/amd.js":{"path":"./src/amd.js","s":{"1":1,"2":1,"3":0,"4":0,"5":0,"6":1,"7":0,"8":0,"9":0},"b":{"1":[0,1],"2":[0,1],"3":[1,0]},"f":{"1":1,"2":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":26}}},"2":{"name":"(anonymous_2)","line":14,"loc":{"start":{"line":14,"column":8},"end":{"line":14,"column":31}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":20,"column":4}},"2":{"start":{"line":2,"column":2},"end":{"line":13,"column":3}},"3":{"start":{"line":4,"column":4},"end":{"line":4,"column":43}},"4":{"start":{"line":5,"column":4},"end":{"line":5,"column":39}},"5":{"start":{"line":7,"column":4},"end":{"line":7,"column":51}},"6":{"start":{"line":9,"column":9},"end":{"line":13,"column":3}},"7":{"start":{"line":11,"column":4},"end":{"line":11,"column":48}},"8":{"start":{"line":15,"column":2},"end":{"line":15,"column":18}},"9":{"start":{"line":18,"column":2},"end":{"line":18,"column":37}}},"branchMap":{"1":{"line":2,"type":"if","locations":[{"start":{"line":2,"column":2},"end":{"line":2,"column":2}},{"start":{"line":2,"column":2},"end":{"line":2,"column":2}}]},"2":{"line":9,"type":"if","locations":[{"start":{"line":9,"column":9},"end":{"line":9,"column":9}},{"start":{"line":9,"column":9},"end":{"line":9,"column":9}}]},"3":{"line":9,"type":"binary-expr","locations":[{"start":{"line":9,"column":13},"end":{"line":9,"column":41}},{"start":{"line":9,"column":45},"end":{"line":9,"column":55}}]}}},"./src/childviewcontainer.js":{"path":"./src/childviewcontainer.js","s":{"1":1,"2":1,"3":19,"4":19,"5":19,"6":19,"7":19,"8":1,"9":25,"10":25,"11":25,"12":6,"13":25,"14":7,"15":25,"16":25,"17":2,"18":2,"19":2,"20":2,"21":2,"22":3,"23":8,"24":5,"25":5,"26":5,"27":5,"28":4,"29":4,"30":4,"31":5,"32":5,"33":5,"34":3,"35":5,"36":10,"37":9,"38":49,"39":1,"40":1,"41":23,"42":2,"43":2,"44":2,"45":1},"b":{"1":[6,19],"2":[7,18],"3":[5,0],"4":[4,0],"5":[9,1],"6":[9,0]},"f":{"1":1,"2":19,"3":25,"4":2,"5":2,"6":2,"7":3,"8":8,"9":5,"10":4,"11":3,"12":5,"13":10,"14":49,"15":23,"16":2},"fnMap":{"1":{"name":"(anonymous_1)","line":7,"loc":{"start":{"line":7,"column":31},"end":{"line":7,"column":52}}},"2":{"name":"(anonymous_2)","line":12,"loc":{"start":{"line":12,"column":18},"end":{"line":12,"column":33}}},"3":{"name":"(anonymous_3)","line":30,"loc":{"start":{"line":30,"column":9},"end":{"line":30,"column":36}}},"4":{"name":"(anonymous_4)","line":52,"loc":{"start":{"line":52,"column":17},"end":{"line":52,"column":32}}},"5":{"name":"(anonymous_5)","line":59,"loc":{"start":{"line":59,"column":20},"end":{"line":59,"column":38}}},"6":{"name":"(anonymous_6)","line":65,"loc":{"start":{"line":65,"column":18},"end":{"line":65,"column":33}}},"7":{"name":"(anonymous_7)","line":72,"loc":{"start":{"line":72,"column":17},"end":{"line":72,"column":32}}},"8":{"name":"(anonymous_8)","line":77,"loc":{"start":{"line":77,"column":15},"end":{"line":77,"column":28}}},"9":{"name":"(anonymous_9)","line":82,"loc":{"start":{"line":82,"column":12},"end":{"line":82,"column":26}}},"10":{"name":"(anonymous_10)","line":91,"loc":{"start":{"line":91,"column":33},"end":{"line":91,"column":52}}},"11":{"name":"(anonymous_11)","line":109,"loc":{"start":{"line":109,"column":10},"end":{"line":109,"column":26}}},"12":{"name":"(anonymous_12)","line":116,"loc":{"start":{"line":116,"column":11},"end":{"line":116,"column":33}}},"13":{"name":"(anonymous_13)","line":117,"loc":{"start":{"line":117,"column":26},"end":{"line":117,"column":40}}},"14":{"name":"(anonymous_14)","line":125,"loc":{"start":{"line":125,"column":19},"end":{"line":125,"column":29}}},"15":{"name":"(anonymous_15)","line":140,"loc":{"start":{"line":140,"column":18},"end":{"line":140,"column":35}}},"16":{"name":"(anonymous_16)","line":141,"loc":{"start":{"line":141,"column":34},"end":{"line":141,"column":45}}}},"statementMap":{"1":{"start":{"line":7,"column":0},"end":{"line":150,"column":16}},"2":{"start":{"line":12,"column":2},"end":{"line":19,"column":4}},"3":{"start":{"line":13,"column":4},"end":{"line":13,"column":21}},"4":{"start":{"line":14,"column":4},"end":{"line":14,"column":28}},"5":{"start":{"line":15,"column":4},"end":{"line":15,"column":29}},"6":{"start":{"line":16,"column":4},"end":{"line":16,"column":25}},"7":{"start":{"line":18,"column":4},"end":{"line":18,"column":34}},"8":{"start":{"line":24,"column":2},"end":{"line":128,"column":5}},"9":{"start":{"line":31,"column":6},"end":{"line":31,"column":29}},"10":{"start":{"line":34,"column":6},"end":{"line":34,"column":34}},"11":{"start":{"line":37,"column":6},"end":{"line":39,"column":7}},"12":{"start":{"line":38,"column":8},"end":{"line":38,"column":53}},"13":{"start":{"line":42,"column":6},"end":{"line":44,"column":7}},"14":{"start":{"line":43,"column":8},"end":{"line":43,"column":51}},"15":{"start":{"line":46,"column":6},"end":{"line":46,"column":27}},"16":{"start":{"line":47,"column":6},"end":{"line":47,"column":18}},"17":{"start":{"line":53,"column":6},"end":{"line":53,"column":44}},"18":{"start":{"line":60,"column":6},"end":{"line":60,"column":49}},"19":{"start":{"line":61,"column":6},"end":{"line":61,"column":37}},"20":{"start":{"line":66,"column":6},"end":{"line":66,"column":47}},"21":{"start":{"line":67,"column":6},"end":{"line":67,"column":37}},"22":{"start":{"line":73,"column":6},"end":{"line":73,"column":42}},"23":{"start":{"line":78,"column":6},"end":{"line":78,"column":30}},"24":{"start":{"line":83,"column":6},"end":{"line":83,"column":29}},"25":{"start":{"line":86,"column":6},"end":{"line":88,"column":7}},"26":{"start":{"line":87,"column":8},"end":{"line":87,"column":50}},"27":{"start":{"line":91,"column":6},"end":{"line":96,"column":15}},"28":{"start":{"line":92,"column":8},"end":{"line":95,"column":9}},"29":{"start":{"line":93,"column":10},"end":{"line":93,"column":42}},"30":{"start":{"line":94,"column":10},"end":{"line":94,"column":22}},"31":{"start":{"line":99,"column":6},"end":{"line":99,"column":34}},"32":{"start":{"line":102,"column":6},"end":{"line":102,"column":27}},"33":{"start":{"line":103,"column":6},"end":{"line":103,"column":18}},"34":{"start":{"line":110,"column":6},"end":{"line":110,"column":44}},"35":{"start":{"line":117,"column":6},"end":{"line":121,"column":9}},"36":{"start":{"line":118,"column":8},"end":{"line":120,"column":9}},"37":{"start":{"line":119,"column":10},"end":{"line":119,"column":47}},"38":{"start":{"line":126,"column":6},"end":{"line":126,"column":40}},"39":{"start":{"line":135,"column":2},"end":{"line":138,"column":43}},"40":{"start":{"line":140,"column":2},"end":{"line":146,"column":5}},"41":{"start":{"line":141,"column":4},"end":{"line":145,"column":6}},"42":{"start":{"line":142,"column":6},"end":{"line":142,"column":40}},"43":{"start":{"line":143,"column":6},"end":{"line":143,"column":54}},"44":{"start":{"line":144,"column":6},"end":{"line":144,"column":38}},"45":{"start":{"line":149,"column":2},"end":{"line":149,"column":19}}},"branchMap":{"1":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":6},"end":{"line":37,"column":6}},{"start":{"line":37,"column":6},"end":{"line":37,"column":6}}]},"2":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":6},"end":{"line":42,"column":6}},{"start":{"line":42,"column":6},"end":{"line":42,"column":6}}]},"3":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":6},"end":{"line":86,"column":6}},{"start":{"line":86,"column":6},"end":{"line":86,"column":6}}]},"4":{"line":92,"type":"if","locations":[{"start":{"line":92,"column":8},"end":{"line":92,"column":8}},{"start":{"line":92,"column":8},"end":{"line":92,"column":8}}]},"5":{"line":118,"type":"if","locations":[{"start":{"line":118,"column":8},"end":{"line":118,"column":8}},{"start":{"line":118,"column":8},"end":{"line":118,"column":8}}]},"6":{"line":119,"type":"binary-expr","locations":[{"start":{"line":119,"column":35},"end":{"line":119,"column":39}},{"start":{"line":119,"column":43},"end":{"line":119,"column":45}}]}}}}

@@ -124,2 +124,24 @@ describe("childview container", function(){

describe("adding or removing a view", function(){
var container, view, model;
beforeEach(function(){
model = new Backbone.Model();
view = new Backbone.View({
model: model
});
container = new Backbone.ChildViewContainer();
});
it("should return itself when adding, for chaining methods", function(){
expect(container.add(view)).toBe(container);
});
it("should return itself when removing, for chaining methods", function(){
expect(container.remove(view)).toBe(container);
});
});
describe("when a container has 2 views in it", function(){

@@ -126,0 +148,0 @@

@@ -47,2 +47,3 @@ // Backbone.ChildViewContainer

this._updateLength();
return this;
},

@@ -76,3 +77,3 @@

// retrieve a view by it's `cid` directly
// retrieve a view by its `cid` directly
findByCid: function(cid){

@@ -104,2 +105,3 @@ return this._views[cid];

this._updateLength();
return this;
},

@@ -106,0 +108,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc