From 63e1ebc1899b5cf8a36c8304f65963dba33dfb1a Mon Sep 17 00:00:00 2001 From: James Yu Date: Thu, 26 Dec 2024 11:19:27 +0800 Subject: [PATCH] Spread mode should correctly register synctex handler --- viewer/components/synctex.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/viewer/components/synctex.ts b/viewer/components/synctex.ts index 815d5e349..5ceecbabb 100644 --- a/viewer/components/synctex.ts +++ b/viewer/components/synctex.ts @@ -45,7 +45,8 @@ function callSynctex(e: MouseEvent, page: number, pageDom: HTMLElement, viewerCo export function registerSyncTeX() { const viewerDom = document.getElementById('viewer')! - for (const pageDom of viewerDom.childNodes as NodeListOf) { + const pageDomList = (viewerDom.childNodes[0] as HTMLElement).classList.contains('spread') ? viewerDom.childNodes[0].childNodes : viewerDom.childNodes + for (const pageDom of pageDomList as NodeListOf) { const page = Number(pageDom.dataset.pageNumber) const viewerContainer = document.getElementById('viewerContainer')! switch (reverseSynctexKeybinding) {