mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 08:24:50 +03:00
Smooth reload animation
This commit is contained in:
parent
de06ab1a41
commit
18931eaca0
6 changed files with 97 additions and 16 deletions
50
dev/External/ko.js
vendored
50
dev/External/ko.js
vendored
|
|
@ -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 ()
|
||||
|
|
|
|||
|
|
@ -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.<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];
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue