Skip to content

Commit

Permalink
Spread mode should correctly register synctex handler
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Yu committed Dec 26, 2024
1 parent 31614f3 commit 63e1ebc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion viewer/components/synctex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLElement>) {
const pageDomList = (viewerDom.childNodes[0] as HTMLElement).classList.contains('spread') ? viewerDom.childNodes[0].childNodes : viewerDom.childNodes
for (const pageDom of pageDomList as NodeListOf<HTMLElement>) {
const page = Number(pageDom.dataset.pageNumber)
const viewerContainer = document.getElementById('viewerContainer')!
switch (reverseSynctexKeybinding) {
Expand Down

0 comments on commit 63e1ebc

Please sign in to comment.