Code refactoring (es5 -> es2015)

This commit is contained in:
RainLoop Team 2016-07-07 00:03:30 +03:00
parent fb2e492ce8
commit 38a1041a73
42 changed files with 3081 additions and 3690 deletions

46
dev/Model/Template.jsx Normal file
View file

@ -0,0 +1,46 @@
import ko from 'ko';
import {pString} from 'Common/Utils';
import {AbstractModel} from 'Knoin/AbstractModel';
class TemplateModel extends AbstractModel
{
/**
* @param {string} id
* @param {string} name
* @param {string} body
*/
constructor(id, name, body)
{
super('TemplateModel');
this.id = id;
this.name = name;
this.body = body;
this.populated = true;
this.deleteAccess = ko.observable(false);
}
/**
* @returns {boolean}
*/
parse(json) {
let result = false;
if (json && 'Object/Template' === json['@Object'])
{
this.id = pString(json.ID);
this.name = pString(json.Name);
this.body = pString(json.Body);
this.populated = !!json.Populated;
result = true;
}
return result;
}
}
export {TemplateModel, TemplateModel as default};