Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions backbone-nested.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
* Copyright (c) 2011-2012 Aidan Feldman
* MIT Licensed (LICENSE)
*/
/*global $, _, Backbone */
/*global require, module, $, _, Backbone */
(function(){
'use strict';

var $ = this.$;
var _ = (typeof require === "function" ? require('underscore') : void 0) || this._;
var Backbone = (typeof require === "function" ? require('backbone') : void 0) || this.Backbone;
var deepExtendPlainObjects = (typeof require === "function" ? require('bal-util').deepExtendPlainObjects : void 0) || function(){
var args = Array.prototype.slice.call(arguments);
args.unshift(true);
return $.extend.apply($,args);
};
var _delayedTriggers = [];

Backbone.NestedModel = Backbone.Model.extend({
Expand Down Expand Up @@ -296,7 +304,7 @@
},

deepClone: function(obj){
return $.extend(true, {}, obj);
return deepExtendPlainObjects({}, obj);
},

walkPath: function(obj, attrPath, callback, scope){
Expand All @@ -315,4 +323,10 @@

});

}());

// Node Export
if ( module && module.exports ) {
module.exports = Backbone;
}

}).call(this);
21 changes: 17 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{
"name": "backbone-nested",
"version": "1.1.2",
"version": "1.1.3",
"description": "A plugin to make Backbone.js keep track of nested attributes.",
"dependencies": {
"backbone": "0.9.x"
"bal-util": "~1.16.1"
},
"peerDependencies": {
"underscore": "~1.4.4",
"backbone": "0.9.2"
},
"devDependencies": {
"grunt": "0.3.x"
Expand All @@ -12,9 +16,18 @@
"main": "backbone-nested.js",
"repositories": [
{
"type": "git",
"type": "git",
"url": "https://github.com/afeld/backbone-nested.git"
}
],
"github": "https://github.com/afeld/backbone-nested"
"github": "https://github.com/afeld/backbone-nested",
"author": "Aidan Feldman <[email protected]> (https://github.com/afeld)",
"maintainers": [
"Aidan Feldman <[email protected]> (https://github.com/afeld)",
"Benjamin Lupton <[email protected]> (https://github.com/balupton)"
],
"contributors": [
"Aidan Feldman <[email protected]> (https://github.com/afeld)",
"Benjamin Lupton <[email protected]> (https://github.com/balupton)"
]
}