mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Code refactoring (es5 -> es2015)
This commit is contained in:
parent
fb2e492ce8
commit
38a1041a73
42 changed files with 3081 additions and 3690 deletions
|
|
@ -1,44 +0,0 @@
|
|||
|
||||
var
|
||||
_ = require('_'),
|
||||
ko = require('ko'),
|
||||
|
||||
AbstractModel = require('Knoin/AbstractModel');
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {string} sId
|
||||
* @param {string} sEmail
|
||||
*/
|
||||
function IdentityModel(sId, sEmail)
|
||||
{
|
||||
AbstractModel.call(this, 'IdentityModel');
|
||||
|
||||
this.id = ko.observable(sId || '');
|
||||
this.email = ko.observable(sEmail);
|
||||
this.name = ko.observable('');
|
||||
|
||||
this.replyTo = ko.observable('');
|
||||
this.bcc = ko.observable('');
|
||||
|
||||
this.signature = ko.observable('');
|
||||
this.signatureInsertBefore = ko.observable(false);
|
||||
|
||||
this.deleteAccess = ko.observable(false);
|
||||
this.canBeDeleted = ko.computed(function() {
|
||||
return '' !== this.id();
|
||||
}, this);
|
||||
}
|
||||
|
||||
_.extend(IdentityModel.prototype, AbstractModel.prototype);
|
||||
|
||||
IdentityModel.prototype.formattedName = function()
|
||||
{
|
||||
var
|
||||
sName = this.name(),
|
||||
sEmail = this.email();
|
||||
|
||||
return ('' !== sName) ? sName + ' (' + sEmail + ')' : sEmail;
|
||||
};
|
||||
|
||||
module.exports = IdentityModel;
|
||||
Loading…
Add table
Add a link
Reference in a new issue