mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 14:07:04 +03:00
Code refactoring (es5 -> es2015)
This commit is contained in:
parent
fb2e492ce8
commit
38a1041a73
42 changed files with 3081 additions and 3690 deletions
36
dev/Model/Account.jsx
Normal file
36
dev/Model/Account.jsx
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
|
||||
import ko from 'ko';
|
||||
|
||||
import {change} from 'Common/Links';
|
||||
|
||||
import {AbstractModel} from 'Knoin/AbstractModel';
|
||||
|
||||
class AccountModel extends AbstractModel
|
||||
{
|
||||
/**
|
||||
* @param {string} email
|
||||
* @param {boolean=} canBeDelete = true
|
||||
* @param {number=} count = 0
|
||||
*/
|
||||
constructor(email, canBeDelete = true, count = 0)
|
||||
{
|
||||
super('AccountModel');
|
||||
|
||||
this.email = email;
|
||||
|
||||
this.count = ko.observable(count);
|
||||
|
||||
this.deleteAccess = ko.observable(false);
|
||||
this.canBeDeleted = ko.observable(!!canBeDelete);
|
||||
this.canBeEdit = this.canBeDeleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
changeAccountLink() {
|
||||
return change(this.email);
|
||||
}
|
||||
}
|
||||
|
||||
export {AccountModel, AccountModel as default};
|
||||
Loading…
Add table
Add a link
Reference in a new issue