Skip to content

Commit fb0e2b0

Browse files
committed
Fix #4459 Additional menu buttons in PDF viewer drop down menu no longer hide menu on click
1 parent bd01da6 commit fb0e2b0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

viewer/components/gui.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ export async function patchViewerUI() {
7777
for (const node of template.content.childNodes) {
7878
anchor.parentNode?.insertBefore(node, anchor)
7979
}
80-
80+
const trimButton = document.getElementById('TrimButton')! as HTMLButtonElement
81+
trimButton.addEventListener('click', (e) => {
82+
e.stopPropagation()
83+
})
8184
registerSynctexCheckBox()
8285
registerAutoReloadCheckBox()
8386

@@ -104,17 +107,19 @@ export async function patchViewerUI() {
104107
function registerSynctexCheckBox() {
105108
const synctexOn = document.getElementById('synctexOn')! as HTMLInputElement
106109
const synctexOnButton = document.getElementById('synctexOnButton')! as HTMLInputElement
107-
synctexOnButton.addEventListener('click', () => {
110+
synctexOnButton.addEventListener('click', (e) => {
108111
synctexOn.checked = toggleSyncTeX()
112+
e.stopPropagation()
109113
// PDFViewerApplication.secondaryToolbar.close()
110114
})
111115
}
112116

113117
function registerAutoReloadCheckBox() {
114118
const autoRefreshOn = document.getElementById('autoRefreshOn')! as HTMLInputElement
115119
const autoRefreshOnButton = document.getElementById('autoRefreshOnButton')! as HTMLButtonElement
116-
autoRefreshOnButton.addEventListener('click', () => {
120+
autoRefreshOnButton.addEventListener('click', (e) => {
117121
autoRefreshOn.checked = toggleAutoRefresh()
122+
e.stopPropagation()
118123
// PDFViewerApplication.secondaryToolbar.close()
119124
})
120125
}

0 commit comments

Comments
 (0)