diff --git a/hugo/assets/ts/widgets/header.ts b/hugo/assets/ts/widgets/header.ts index 5e1165afd4..80be0607d3 100644 --- a/hugo/assets/ts/widgets/header.ts +++ b/hugo/assets/ts/widgets/header.ts @@ -45,7 +45,7 @@ export class Header extends BaseWidget { public onScroll(): void { this.scrollY = window.scrollY; - this.scrollingDown = (this.scrollY > this.scrollYOld); + this.scrollingDown = (this.scrollY >= this.scrollYOld); this.scrollYOld = this.scrollY; if (!this.updateScheduled) { diff --git a/hugo/assets/ts/widgets/tabs-nav.ts b/hugo/assets/ts/widgets/tabs-nav.ts index af7c7177a0..f6219c6ecb 100644 --- a/hugo/assets/ts/widgets/tabs-nav.ts +++ b/hugo/assets/ts/widgets/tabs-nav.ts @@ -38,6 +38,10 @@ export class TabsNav extends BaseWidget { } public init(): void { + if (!this.tabList) { + return; + } + this.checkPaginationEnabled(); // Reset scroll + check for pagination on resize @@ -63,6 +67,7 @@ export class TabsNav extends BaseWidget { this.handlePagination('next'); }); } + public checkPaginationEnabled(): void { // Calculate if tablist doesn't fit in container const elemWidth = this.element.offsetWidth +