diff --git a/src/dom/epub/epub-view.ts b/src/dom/epub/epub-view.ts index 26f1f98c..3ab734b1 100644 --- a/src/dom/epub/epub-view.ts +++ b/src/dom/epub/epub-view.ts @@ -91,6 +91,8 @@ class EPUBView extends DOMView { private _pageMappingJSON!: string; + private _lastNavigationTime = 0; + constructor(options: DOMViewOptions) { super(options); if (options.data.buf) { @@ -836,7 +838,7 @@ class EPUBView extends DOMView { canNavigateToNextSection: this.canNavigateToNextSection(), flowMode: this.flowMode, spreadMode: this.spreadMode, - outlinePath: this._getOutlinePath() + outlinePath: Date.now() - this._lastNavigationTime > 1500 ? this._getOutlinePath() : undefined, }; this._options.onChangeViewStats(viewStats); } @@ -1151,6 +1153,8 @@ class EPUBView extends DOMView { override navigate(location: NavLocation, options: NavigateOptions = {}) { console.log('Navigating to', location); + this._lastNavigationTime = Date.now(); + options.behavior ||= 'smooth'; if (location.pageNumber) {