@@ -77,7 +77,10 @@ export async function patchViewerUI() {
77
77
for ( const node of template . content . childNodes ) {
78
78
anchor . parentNode ?. insertBefore ( node , anchor )
79
79
}
80
-
80
+ const trimButton = document . getElementById ( 'TrimButton' ) ! as HTMLButtonElement
81
+ trimButton . addEventListener ( 'click' , ( e ) => {
82
+ e . stopPropagation ( )
83
+ } )
81
84
registerSynctexCheckBox ( )
82
85
registerAutoReloadCheckBox ( )
83
86
@@ -104,17 +107,19 @@ export async function patchViewerUI() {
104
107
function registerSynctexCheckBox ( ) {
105
108
const synctexOn = document . getElementById ( 'synctexOn' ) ! as HTMLInputElement
106
109
const synctexOnButton = document . getElementById ( 'synctexOnButton' ) ! as HTMLInputElement
107
- synctexOnButton . addEventListener ( 'click' , ( ) => {
110
+ synctexOnButton . addEventListener ( 'click' , ( e ) => {
108
111
synctexOn . checked = toggleSyncTeX ( )
112
+ e . stopPropagation ( )
109
113
// PDFViewerApplication.secondaryToolbar.close()
110
114
} )
111
115
}
112
116
113
117
function registerAutoReloadCheckBox ( ) {
114
118
const autoRefreshOn = document . getElementById ( 'autoRefreshOn' ) ! as HTMLInputElement
115
119
const autoRefreshOnButton = document . getElementById ( 'autoRefreshOnButton' ) ! as HTMLButtonElement
116
- autoRefreshOnButton . addEventListener ( 'click' , ( ) => {
120
+ autoRefreshOnButton . addEventListener ( 'click' , ( e ) => {
117
121
autoRefreshOn . checked = toggleAutoRefresh ( )
122
+ e . stopPropagation ( )
118
123
// PDFViewerApplication.secondaryToolbar.close()
119
124
} )
120
125
}
0 commit comments