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) {