SrolltoTop optimization

This commit is contained in:
RainLoop Team 2014-11-20 03:25:39 +04:00
parent 7841658791
commit b9a93e82ec
3 changed files with 14 additions and 3 deletions

View file

@ -607,7 +607,7 @@
return false; return false;
} }
if (bFast) if (bFast || 50 > this.oContentScrollable.scrollTop())
{ {
this.oContentScrollable.scrollTop(0); this.oContentScrollable.scrollTop(0);
} }

View file

@ -325,7 +325,7 @@
this.testingDone(false); this.testingDone(false);
this.testingImapError(false); this.testingImapError(false);
this.testingSmtpError(false); this.testingSmtpError(false);
} };
DomainPopupView.prototype.onHide = function () DomainPopupView.prototype.onHide = function ()
{ {

View file

@ -639,8 +639,19 @@
MessageViewMailBoxUserView.prototype.scrollMessageToTop = function () MessageViewMailBoxUserView.prototype.scrollMessageToTop = function ()
{ {
if (this.oMessageScrollerDom) if (this.oMessageScrollerDom)
{
if (50 < this.oMessageScrollerDom.scrollTop())
{
this.oMessageScrollerDom
.scrollTop(50)
.animate({'scrollTop': 0}, 200)
;
}
else
{ {
this.oMessageScrollerDom.scrollTop(0); this.oMessageScrollerDom.scrollTop(0);
}
Utils.windowResize(); Utils.windowResize();
} }
}; };