diff --git a/dev/External/ko.js b/dev/External/ko.js index 921c0c8cf..eb2c1d8b4 100644 --- a/dev/External/ko.js +++ b/dev/External/ko.js @@ -938,23 +938,59 @@ ko.extenders.falseTimeout = function (oTarget, iOption) { - var Utils = require('Common/Utils'); - - oTarget.iTimeout = 0; + oTarget.iFalseTimeoutTimeout = 0; oTarget.subscribe(function (bValue) { if (bValue) { - window.clearTimeout(oTarget.iTimeout); - oTarget.iTimeout = window.setTimeout(function () { + window.clearTimeout(oTarget.iFalseTimeoutTimeout); + oTarget.iFalseTimeoutTimeout = window.setTimeout(function () { oTarget(false); - oTarget.iTimeout = 0; - }, Utils.pInt(iOption)); + oTarget.iFalseTimeoutTimeout = 0; + }, require('Common/Utils').pInt(iOption)); } }); return oTarget; }; + ko.extenders.specialThrottle = function (oTarget, iOption) + { + oTarget.iSpecialThrottleTimeoutValue = require('Common/Utils').pInt(iOption); + if (0 < oTarget.iSpecialThrottleTimeoutValue) + { + oTarget.iSpecialThrottleTimeout = 0; + oTarget.valueForRead = ko.observable(!!oTarget()).extend({'throttle': 10}); + + return ko.computed({ + 'read': oTarget.valueForRead, + 'write': function (bValue) { + + if (bValue) + { + oTarget.valueForRead(bValue); + } + else + { + if (oTarget.valueForRead()) + { + window.clearTimeout(oTarget.iSpecialThrottleTimeout); + oTarget.iSpecialThrottleTimeout = window.setTimeout(function () { + oTarget.valueForRead(false); + oTarget.iSpecialThrottleTimeout = 0; + }, oTarget.iSpecialThrottleTimeoutValue); + } + else + { + oTarget.valueForRead(bValue); + } + } + } + }); + } + + return oTarget; + }; + // functions ko.observable.fn.validateNone = function () diff --git a/dev/Model/Message.js b/dev/Model/Message.js index e20ca8ac3..c9f89d51e 100644 --- a/dev/Model/Message.js +++ b/dev/Model/Message.js @@ -662,9 +662,10 @@ /** * @param {Object} oExcludeEmails + * @param {boolean=} bLast = false * @return {Array} */ - MessageModel.prototype.replyEmails = function (oExcludeEmails) + MessageModel.prototype.replyEmails = function (oExcludeEmails, bLast) { var aResult = [], @@ -677,16 +678,23 @@ MessageHelper.replyHelper(this.from, oUnic, aResult); } + if (0 === aResult.length && !bLast) + { + return this.replyEmails({}, true); + } + return aResult; }; /** * @param {Object} oExcludeEmails + * @param {boolean=} bLast = false * @return {Array.} */ - MessageModel.prototype.replyAllEmails = function (oExcludeEmails) + MessageModel.prototype.replyAllEmails = function (oExcludeEmails, bLast) { var + aData = [], aToResult = [], aCcResult = [], oUnic = Utils.isUnd(oExcludeEmails) ? {} : oExcludeEmails @@ -701,6 +709,12 @@ MessageHelper.replyHelper(this.to, oUnic, aToResult); MessageHelper.replyHelper(this.cc, oUnic, aCcResult); + if (0 === aToResult.length && !bLast) + { + aData = this.replyAllEmails({}, true); + return [aData[0], aCcResult]; + } + return [aToResult, aCcResult]; }; diff --git a/dev/Stores/User/Message.js b/dev/Stores/User/Message.js index f6e5e4a0a..db4a69c15 100644 --- a/dev/Stores/User/Message.js +++ b/dev/Stores/User/Message.js @@ -51,6 +51,7 @@ this.messageListLoading = ko.observable(false); this.messageListIsNotCompleted = ko.observable(false); this.messageListCompleteLoadingThrottle = ko.observable(false).extend({'throttle': 200}); + this.messageListCompleteLoadingThrottleForAnimation = ko.observable(false).extend({'specialThrottle': 700}); this.messageListDisableAutoSelect = ko.observable(false).extend({'falseTimeout': 500}); @@ -164,7 +165,9 @@ MessageUserStore.prototype.subscribers = function () { this.messageListCompleteLoading.subscribe(function (bValue) { + bValue = !!bValue; this.messageListCompleteLoadingThrottle(bValue); + this.messageListCompleteLoadingThrottleForAnimation(bValue); }, this); this.messageList.subscribe(_.debounce(function (aList) { diff --git a/dev/Styles/Animations.less b/dev/Styles/Animations.less index fb25641ba..968d2fa0a 100644 --- a/dev/Styles/Animations.less +++ b/dev/Styles/Animations.less @@ -9,6 +9,10 @@ 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } } +@keyframes bounce-me { + 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } +} + @keyframes textLoadingAnimationKeyFrame { 0% { opacity: 1; } 33% { opacity: 0; } 100% { opacity: 1; } } @@ -56,6 +60,10 @@ html.csstransitions.rl-started-trigger.no-mobile .b-login-content .loginFormWrap .transition(opacity 0.3s ease-out); }*/ + &.csstransitions.no-mobile .btn-group.dropdown.colored-toggle.open .animate-this-icon-on-open { + animation: bounce-me .5s linear; + } + &.csstransitions.no-mobile .b-login-content .loginFormWrapper { .transition(all 0.3s ease-out); } diff --git a/dev/View/User/MailBox/MessageList.js b/dev/View/User/MailBox/MessageList.js index cb42fcbb1..6068c73ff 100644 --- a/dev/View/User/MailBox/MessageList.js +++ b/dev/View/User/MailBox/MessageList.js @@ -70,6 +70,7 @@ this.messageListCheckedOrSelected = MessageStore.messageListCheckedOrSelected; this.messageListCheckedOrSelectedUidsWithSubMails = MessageStore.messageListCheckedOrSelectedUidsWithSubMails; this.messageListCompleteLoadingThrottle = MessageStore.messageListCompleteLoadingThrottle; + this.messageListCompleteLoadingThrottleForAnimation = MessageStore.messageListCompleteLoadingThrottleForAnimation; Translator.initOnStartOrLangChange(function () { this.emptySubjectValue = Translator.i18n('MESSAGE_LIST/EMPTY_SUBJECT_TEXT'); @@ -174,6 +175,18 @@ return Consts.Values.UnuseOptionValue === FolderStore.archiveFolder(); }, this); + this.isArchiveVisible = ko.computed(function () { + return !this.isArchiveFolder() && !this.isArchiveDisabled() && !this.isDraftFolder(); + }, this); + + this.isSpamVisible = ko.computed(function () { + return !this.isSpamFolder() && !this.isSpamDisabled() && !this.isDraftFolder() && !this.isSentFolder(); + }, this); + + this.isUnSpamVisible = ko.computed(function () { + return this.isSpamFolder() && !this.isSpamDisabled() && !this.isDraftFolder() && !this.isSentFolder(); + }, this); + this.canBeMoved = this.hasCheckedOrSelectedLines; this.clearCommand = Utils.createCommand(this, function () { @@ -218,7 +231,7 @@ this.moveCommand = Utils.createCommand(this, Utils.emptyFunction, this.canBeMoved); this.reloadCommand = Utils.createCommand(this, function () { - if (!MessageStore.messageListCompleteLoadingThrottle()) + if (!MessageStore.messageListCompleteLoadingThrottleForAnimation()) { require('App/User').reloadMessageList(false, true); } diff --git a/rainloop/v/0.0.0/app/templates/Views/User/MailMessageList.html b/rainloop/v/0.0.0/app/templates/Views/User/MailMessageList.html index f1963ead6..5dec6dbee 100644 --- a/rainloop/v/0.0.0/app/templates/Views/User/MailMessageList.html +++ b/rainloop/v/0.0.0/app/templates/Views/User/MailMessageList.html @@ -5,7 +5,7 @@
 
@@ -29,16 +29,23 @@
 
- + - + - + - + @@ -46,7 +53,7 @@