JD2022-TU1/data/EngineData/SubmitAssistant/model/file.js

46 lines
No EOL
827 B
JavaScript

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;
});