mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
*.jsx -> *.js
This commit is contained in:
parent
0a2b826f71
commit
e88c193334
98 changed files with 341 additions and 340 deletions
42
dev/Model/Identity.js
Normal file
42
dev/Model/Identity.js
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