Interface optimization

Mark as important (compose)
This commit is contained in:
RainLoop Team 2014-12-31 16:21:43 +04:00
parent 821991a263
commit d5eacb6a4d
43 changed files with 1069 additions and 780 deletions

View file

@ -47,6 +47,8 @@
this.bCapaAdditionalIdentities = Settings.capa(Enums.Capa.AdditionalIdentities);
this.allowContacts = !!Settings.settingsGet('ContactsIsAllowed');
var
self = this,
fCcAndBccCheckHelper = function (aValue) {
@ -76,6 +78,7 @@
this.isHtml = ko.observable(false);
this.requestReadReceipt = ko.observable(false);
this.markAsImportant = ko.observable(false);
this.sendError = ko.observable(false);
this.sendSuccessButSaveError = ko.observable(false);
@ -298,7 +301,8 @@
this.aDraftInfo,
this.sInReplyTo,
this.sReferences,
this.requestReadReceipt()
this.requestReadReceipt(),
this.markAsImportant()
);
}
}
@ -334,7 +338,8 @@
this.prepearAttachmentsForSendOrSave(),
this.aDraftInfo,
this.sInReplyTo,
this.sReferences
this.sReferences,
this.markAsImportant()
);
}
@ -354,6 +359,21 @@
}, this.canBeSendedOrSaved);
this.contactsCommand = Utils.createCommand(this, function () {
if (this.allowContacts)
{
this.skipCommand();
_.delay(function () {
kn.showScreenPopup(require('View/Popup/Contacts'), [true]);
}, 200);
}
}, function () {
return this.allowContacts;
});
Events.sub('interval.2m', function () {
if (this.modalVisibility() && !Data.draftFolderNotEnabled() && !this.isEmptyForm(false) &&
@ -800,6 +820,10 @@
self.initOnShow(sType, oMessageOrArray, aToEmails, sCustomSubject, sCustomPlainText);
}, null, null, null, false]);
}
else if (aToEmails && 0 < aToEmails.length)
{
this.addEmailsToTo(aToEmails);
}
}
else
{
@ -807,6 +831,23 @@
}
};
/**
* @param {Array} aEmails
*/
ComposePopupView.prototype.addEmailsToTo = function (aEmails)
{
var
sTo = Utils.trim(this.to()),
aTo = []
;
aTo = _.uniq(_.compact(_.map(aEmails, function (oItem) {
return oItem ? oItem.toLine(false) : null;
})));
this.to(sTo + ('' === sTo ? '' : ', ') + Utils.trim(aTo.join(', ')));
};
/**
* @param {string=} sType = Enums.ComposeType.Empty
* @param {?MessageModel|Array=} oMessageOrArray = null
@ -1826,6 +1867,7 @@
this.subject('');
this.requestReadReceipt(false);
this.markAsImportant(false);
this.aDraftInfo = null;
this.sInReplyTo = '';

View file

@ -46,6 +46,8 @@
}
;
this.bBackToCompose = false;
this.allowContactsSync = Data.allowContactsSync;
this.enableContactsSync = Data.enableContactsSync;
this.allowExport = !Globals.bMobileDevice;
@ -261,8 +263,13 @@
if (Utils.isNonEmptyArray(aE))
{
self.bBackToCompose = false;
kn.hideScreenPopup(require('View/Popup/Contacts'));
kn.showScreenPopup(require('View/Popup/Compose'), [Enums.ComposeType.Empty, null, aE]);
_.delay(function () {
kn.showScreenPopup(require('View/Popup/Compose'), [Enums.ComposeType.Empty, null, aE]);
}, 200);
}
}, function () {
@ -716,8 +723,10 @@
this.initUploader();
};
ContactsPopupView.prototype.onShow = function ()
ContactsPopupView.prototype.onShow = function (bBackToCompose)
{
this.bBackToCompose = Utils.isUnd(bBackToCompose) ? false : !!bBackToCompose;
kn.routeOff();
this.reloadContactList(true);
};
@ -732,6 +741,13 @@
Utils.delegateRunOnDestroy(this.contacts());
this.contacts([]);
if (this.bBackToCompose)
{
this.bBackToCompose = false;
kn.showScreenPopup(require('View/Popup/Compose'));
}
};
module.exports = ContactsPopupView;

View file

@ -165,6 +165,7 @@
this.viewDownloadLink = ko.observable('');
this.viewUserPic = ko.observable(Consts.DataImages.UserDotPic);
this.viewUserPicVisible = ko.observable(false);
this.viewIsImportant = ko.observable(false);
this.viewPgpPassword = ko.observable('');
this.viewPgpSignedVerifyStatus = ko.computed(function () {
@ -202,6 +203,7 @@
this.viewLineAsCcc(oMessage.lineAsCcc());
this.viewViewLink(oMessage.viewLink());
this.viewDownloadLink(oMessage.downloadLink());
this.viewIsImportant(oMessage.isImportant());
sLastEmail = oMessage.fromAsSingleEmail();
Cache.getUserPic(sLastEmail, function (sPic, $sEmail) {