mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 04:59:21 +03:00
Bugfix: scrollTop/scrollLeft never worked because .b-content has overflow:auto not the sub-div .content
This commit is contained in:
parent
b3dd0c51b5
commit
e1b274fcb4
10 changed files with 28 additions and 32 deletions
|
|
@ -64,7 +64,7 @@ class FolderListMailBoxUserView extends AbstractViewNext {
|
|||
|
||||
onBuild(dom) {
|
||||
this.oContentVisible = $('.b-content', dom);
|
||||
this.oContentScrollable = $('.content', this.oContentVisible);
|
||||
this.oContentScrollable = this.oContentVisible ? this.oContentVisible[0] : null;
|
||||
|
||||
const self = this,
|
||||
isMobile = Settings.appSettingsGet('mobile'),
|
||||
|
|
@ -220,12 +220,11 @@ class FolderListMailBoxUserView extends AbstractViewNext {
|
|||
focusedHeight = focused.outerHeight();
|
||||
|
||||
if (pos && (0 > pos.top || pos.top + focusedHeight > visibleHeight)) {
|
||||
let top = this.oContentScrollable.scrollTop + pos.top;
|
||||
if (0 > pos.top) {
|
||||
this.oContentScrollable.scrollTop(this.oContentScrollable.scrollTop() + pos.top - offset);
|
||||
this.oContentScrollable.scrollTop = top - offset;
|
||||
} else {
|
||||
this.oContentScrollable.scrollTop(
|
||||
this.oContentScrollable.scrollTop() + pos.top - visibleHeight + focusedHeight + offset
|
||||
);
|
||||
this.oContentScrollable.scrollTop = top - visibleHeight + focusedHeight + offset;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue