Fixed a bug where loading page on book reader wouldn't scroll to last position (#907)
This commit is contained in:
parent
6afbf5f08f
commit
426cb7f0be
2 changed files with 6 additions and 8 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { ElementRef, Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
|
@ -13,8 +13,8 @@ export class ScrollService {
|
|||
|| document.body.scrollTop || 0);
|
||||
}
|
||||
|
||||
scrollTo(top: number) {
|
||||
window.scroll({
|
||||
scrollTo(top: number, el: Element | Window = window) {
|
||||
el.scroll({
|
||||
top: top,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue