Smll fixes

This commit is contained in:
RainLoop Team 2016-04-21 01:42:16 +03:00
parent 6b7a256ca9
commit e6ac4cdff0
6 changed files with 30 additions and 24 deletions

View file

@ -8,7 +8,7 @@
font-size: 16px;
vertical-align: text-top;
.btn.disabled &, .btn[disabled] &{
.disabled &, .btn[disabled] &{
color: grey;
&.icon-white {
color: #fff;

View file

@ -344,6 +344,8 @@
var
sTo = Utils.trim(this.to()),
sCc = Utils.trim(this.cc()),
sBcc = Utils.trim(this.bcc()),
sSentFolder = FolderStore.sentFolder(),
aFlagsCache = []
;
@ -363,7 +365,7 @@
this.attachmentsPlace(true);
}
if (0 === sTo.length)
if ('' === sTo && '' === sCc && '' === sBcc)
{
this.emptyToError(true);
}

View file

@ -5,6 +5,7 @@
var
_ = require('_'),
$ = require('$'),
ko = require('ko'),
key = require('key'),
@ -246,7 +247,6 @@
var
sKeyId = this.selectedPrivateKey(),
oKey = null,
aKeys = this.encryptKeys(),
oOption = sKeyId ? _.find(this.privateKeysOptions(), function (oItem) {
return oItem && sKeyId === oItem.id;
}) : null
@ -317,8 +317,19 @@
}, this);
this.sDefaultKeyScope = Enums.KeyState.PopupComposeOpenPGP;
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
this.addOptionClass = function (oDomOption, oItem) {
self.defautOptionsAfterRender(oDomOption, oItem);
if (oItem && !Utils.isUnd(oItem['class']) && oDomOption)
{
$(oDomOption).addClass(oItem['class']);
}
};
this.deletePublickKey = _.bind(this.deletePublickKey, this);
kn.constructorEnd(this);
@ -327,16 +338,6 @@
kn.extendAsViewModel(['View/Popup/ComposeOpenPgp', 'PopupsComposeOpenPgpViewModel'], ComposeOpenPgpPopupView);
_.extend(ComposeOpenPgpPopupView.prototype, AbstractView.prototype);
ComposeOpenPgpPopupView.prototype.addOptionClass = function (oDomOption, oItem)
{
this.defautOptionsAfterRender(oDomOption, oItem);
if (oItem)
{
oDomOption.classList.add(oItem['class']);
}
};
ComposeOpenPgpPopupView.prototype.deletePublickKey = function (oKey)
{
this.encryptKeys.remove(oKey);
@ -405,7 +406,6 @@
aRec = [],
sEmail = '',
aKeys = [],
oKey = null,
oEmail = new EmailModel()
;
@ -438,13 +438,12 @@
sEmail = oIdentity.email();
aRec.unshift(sEmail);
aKeys = PgpStore.findAllPrivateKeysByEmailNotNative(sEmail);
if (aKeys)
if (aKeys && aKeys[0])
{
var oKey = aKeys[0];
this.signKey({
'users': oKey.users || [sEmail],
'hash': oKey.id.substr(-8).toUpperCase(),
'key': oKey
'users': aKeys[0].users || [sEmail],
'hash': aKeys[0].id.substr(-8).toUpperCase(),
'key': aKeys[0]
});
}
}