define([ "underscore", "backbone", ], function(){ /** * Model to store a file. */ var FileModel = Backbone.Model.extend({ defaults:{ "action": "", "actionOwner": "", "change": "", "clientFile": "", "depotFile": "", "haveRevision": "", "headAction": "", "headChange": "", "headRevision": "", "headTime": "", "headType": "", "isMapped": "", "movedRev": "", "otherLock": "", "ourLock": "", "resolved": "", "type": "", "unresolved": "", //private field "is_selected": true, //by default all files selected }, /* * Override Backbone toJSON method to add cid to the JSON object */ toJSON: function() { var json = Backbone.Model.prototype.toJSON.apply(this, arguments); json.cid = this.cid; return json; }, }); return FileModel; });