mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Code refactoring
This commit is contained in:
parent
79233ad83c
commit
286ab567af
53 changed files with 618 additions and 581 deletions
|
|
@ -7,6 +7,8 @@
|
|||
_ = require('_'),
|
||||
ko = require('ko'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
|
||||
Remote = require('Storage/User/Remote')
|
||||
;
|
||||
|
||||
|
|
@ -15,6 +17,15 @@
|
|||
*/
|
||||
function AccountUserStore()
|
||||
{
|
||||
this.email = ko.observable('');
|
||||
// this.incLogin = ko.observable('');
|
||||
// this.outLogin = ko.observable('');
|
||||
|
||||
this.displayName = ko.observable('');
|
||||
this.replyTo = ko.observable('');
|
||||
this.signature = ko.observable('');
|
||||
this.signatureToAll = ko.observable(false);
|
||||
|
||||
this.accounts = ko.observableArray([]);
|
||||
this.accounts.loading = ko.observable(false).extend({'throttle': 100});
|
||||
|
||||
|
|
@ -42,18 +53,30 @@
|
|||
|
||||
var iResult = 0;
|
||||
|
||||
_.each(this.accounts(), function (oItem) {
|
||||
if (oItem)
|
||||
{
|
||||
iResult += oItem.count();
|
||||
}
|
||||
});
|
||||
// _.each(this.accounts(), function (oItem) {
|
||||
// if (oItem)
|
||||
// {
|
||||
// iResult += oItem.count();
|
||||
// }
|
||||
// });
|
||||
|
||||
return iResult;
|
||||
|
||||
}, this);
|
||||
}
|
||||
|
||||
AccountUserStore.prototype.populate = function ()
|
||||
{
|
||||
this.email(Settings.settingsGet('Email'));
|
||||
// this.incLogin(Settings.settingsGet('IncLogin'));
|
||||
// this.outLogin(Settings.settingsGet('OutLogin'));
|
||||
|
||||
this.displayName(Settings.settingsGet('DisplayName'));
|
||||
this.replyTo(Settings.settingsGet('ReplyTo'));
|
||||
this.signature(Settings.settingsGet('Signature'));
|
||||
this.signatureToAll(!!Settings.settingsGet('SignatureToAll'));
|
||||
};
|
||||
|
||||
module.exports = new AccountUserStore();
|
||||
|
||||
}());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue