Bento, the office suite that fits in a file
TypeScript mit-licenseofficeoffice-365office-suiteoffice-toolsoffice365open-sourcepowerpointself-hostedsingle-page-appslidesslideshareslideshowslideshow-galleryslideshow-makerslideshows
fix: keep active slide thumbnail visible (#149)
Yishen Tu4877d36519e1
diff --git a/slides/src/editor/editor.ts b/slides/src/editor/editor.tsindex 96ef20d3..7e3113f0 100644--- a/slides/src/editor/editor.ts+++ b/slides/src/editor/editor.ts@@ -1604,9 +1604,13 @@ export class Editor {}private highlightSidebar() {+ let active: HTMLElement | undefinedthis.sidebar.querySelectorAll<HTMLElement>('.ed-thumb').forEach((n) => {- n.classList.toggle('active', Number(n.dataset.index) === this.store.currentIndex)+ const isActive = Number(n.dataset.index) === this.store.currentIndex+ n.classList.toggle('active', isActive)+ if (isActive) active = n})+ active?.scrollIntoView({ block: 'nearest', inline: 'nearest' })}private scheduleThumbs() {