mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Code refactoring (es5 -> es2015)
This commit is contained in:
parent
fb2e492ce8
commit
38a1041a73
42 changed files with 3081 additions and 3690 deletions
42
dev/Model/Identity.jsx
Normal file
42
dev/Model/Identity.jsx
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
|
||||
import ko from 'ko';
|
||||
|
||||
import {AbstractModel} from 'Knoin/AbstractModel';
|
||||
|
||||
class IdentityModel extends AbstractModel
|
||||
{
|
||||
/**
|
||||
* @param {string} id
|
||||
* @param {string} email
|
||||
*/
|
||||
constructor(id, email)
|
||||
{
|
||||
super('IdentityModel');
|
||||
|
||||
this.id = ko.observable(id || '');
|
||||
this.email = ko.observable(email);
|
||||
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(() => '' !== this.id());
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
formattedName() {
|
||||
const
|
||||
name = this.name(),
|
||||
email = this.email();
|
||||
|
||||
return '' !== name ? name + ' (' + email + ')' : email;
|
||||
}
|
||||
}
|
||||
|
||||
export {IdentityModel, IdentityModel as default};
|
||||
Loading…
Add table
Add a link
Reference in a new issue