mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Added additional account edit form
This commit is contained in:
parent
c6ec3fb311
commit
ebb6a06c65
36 changed files with 149 additions and 59 deletions
|
|
@ -24,6 +24,8 @@
|
|||
{
|
||||
AbstractView.call(this, 'Popups', 'PopupsAddAccount');
|
||||
|
||||
this.isNew = ko.observable(true);
|
||||
|
||||
this.email = ko.observable('');
|
||||
this.password = ko.observable('');
|
||||
|
||||
|
|
@ -55,10 +57,10 @@
|
|||
|
||||
this.submitRequest(true);
|
||||
|
||||
Remote.accountAdd(_.bind(function (sResult, oData) {
|
||||
Remote.accountSetup(_.bind(function (sResult, oData) {
|
||||
|
||||
this.submitRequest(false);
|
||||
if (Enums.StorageResultType.Success === sResult && oData && 'AccountAdd' === oData.Action)
|
||||
if (Enums.StorageResultType.Success === sResult && oData && 'AccountSetup' === oData.Action)
|
||||
{
|
||||
if (oData.Result)
|
||||
{
|
||||
|
|
@ -75,7 +77,7 @@
|
|||
this.submitError(Utils.getNotification(Enums.Notification.UnknownError));
|
||||
}
|
||||
|
||||
}, this), this.email(), '', this.password());
|
||||
}, this), this.email(), this.password(), this.isNew());
|
||||
|
||||
return true;
|
||||
|
||||
|
|
@ -91,6 +93,8 @@
|
|||
|
||||
AddAccountPopupView.prototype.clearPopup = function ()
|
||||
{
|
||||
this.isNew(true);
|
||||
|
||||
this.email('');
|
||||
this.password('');
|
||||
|
||||
|
|
@ -101,9 +105,14 @@
|
|||
this.submitError('');
|
||||
};
|
||||
|
||||
AddAccountPopupView.prototype.onShow = function ()
|
||||
AddAccountPopupView.prototype.onShow = function (oAccount)
|
||||
{
|
||||
this.clearPopup();
|
||||
if (oAccount && oAccount.canBeEdit())
|
||||
{
|
||||
this.isNew(false);
|
||||
this.email(oAccount.email);
|
||||
}
|
||||
};
|
||||
|
||||
AddAccountPopupView.prototype.onFocus = function ()
|
||||
|
|
|
|||
|
|
@ -104,14 +104,6 @@
|
|||
return !this.submitRequest();
|
||||
});
|
||||
|
||||
this.label = ko.computed(function () {
|
||||
return Utils.i18n('POPUPS_IDENTITIES/' + (this.edit() ? 'TITLE_UPDATE_IDENTITY': 'TITLE_ADD_IDENTITY'));
|
||||
}, this);
|
||||
|
||||
this.button = ko.computed(function () {
|
||||
return Utils.i18n('POPUPS_IDENTITIES/' + (this.edit() ? 'BUTTON_UPDATE_IDENTITY': 'BUTTON_ADD_IDENTITY'));
|
||||
}, this);
|
||||
|
||||
kn.constructorEnd(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue