Code refactoring

This commit is contained in:
RainLoop Team 2015-04-06 23:32:19 +04:00
parent ffde4f03a8
commit b7709c8117
21 changed files with 291 additions and 192 deletions

View file

@ -71,7 +71,7 @@
};
/**
* @param {AjaxJsonMessage} oJson
* @param {Object} oJson
* @return {boolean}
*/
MessageSimpleModel.prototype.initByJson = function (oJson)
@ -85,14 +85,16 @@
this.subject = Utils.pString(oJson.Subject);
this.subjectPrefix = '';
this.subjectSuffix = this.subject;
if (Utils.isArray(oJson.SubjectParts))
{
this.subjectPrefix = Utils.pString(oJson.SubjectParts[0]);
this.subjectSuffix = Utils.pString(oJson.SubjectParts[1]);
}
else
{
this.subjectPrefix = '';
this.subjectSuffix = this.subject;
}
this.from = MessageHelper.emailArrayFromJson(oJson.From);
this.to = MessageHelper.emailArrayFromJson(oJson.To);
@ -132,7 +134,7 @@
/**
* @static
* @param {AjaxJsonMessage} oJson
* @param {Object} oJson
* @return {?MessageSimpleModel}
*/
MessageSimpleModel.newInstanceFromJson = function (oJson)