mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 17:13:38 +08:00
52 lines
No EOL
958 B
JavaScript
52 lines
No EOL
958 B
JavaScript
|
|
(function () {
|
|
|
|
'use strict';
|
|
|
|
var
|
|
_ = require('_'),
|
|
ko = require('ko'),
|
|
|
|
Utils = require('Common/Utils'),
|
|
|
|
AbstractModel = require('Knoin/AbstractModel')
|
|
;
|
|
|
|
/**
|
|
* @constructor
|
|
*
|
|
* @param {string} sEmail
|
|
* @param {boolean=} bCanBeDelete = true
|
|
* @param {number=} iCount = 0
|
|
*/
|
|
function AccountModel(sEmail, bCanBeDelete, iCount)
|
|
{
|
|
AbstractModel.call(this, 'AccountModel');
|
|
|
|
this.email = sEmail;
|
|
|
|
this.count = ko.observable(iCount || 0);
|
|
|
|
this.deleteAccess = ko.observable(false);
|
|
this.canBeDeleted = ko.observable(Utils.isUnd(bCanBeDelete) ? true : !!bCanBeDelete);
|
|
this.canBeEdit = this.canBeDeleted;
|
|
}
|
|
|
|
_.extend(AccountModel.prototype, AbstractModel.prototype);
|
|
|
|
/**
|
|
* @type {string}
|
|
*/
|
|
AccountModel.prototype.email = '';
|
|
|
|
/**
|
|
* @return {string}
|
|
*/
|
|
AccountModel.prototype.changeAccountLink = function ()
|
|
{
|
|
return require('Common/Links').change(this.email);
|
|
};
|
|
|
|
module.exports = AccountModel;
|
|
|
|
}()); |