@@ -21,6 +21,7 @@ import {
2121 getRGBA ,
2222 Util ,
2323} from "pdfjs-lib" ;
24+ import { internalOpt } from "./internal_evt.js" ;
2425
2526/**
2627 * @typedef {Object } AnnotationEditorParamsOptions
@@ -155,42 +156,46 @@ class AnnotationEditorParams {
155156 dispatchEvent ( "CREATE" ) ;
156157 } ) ;
157158
158- eventBus . _on ( "annotationeditorparamschanged" , evt => {
159- for ( const [ type , value ] of evt . details ) {
160- switch ( type ) {
161- case AnnotationEditorParamsType . FREETEXT_SIZE :
162- editorFreeTextFontSize . value = value ;
163- break ;
164- case AnnotationEditorParamsType . FREETEXT_COLOR :
165- editorFreeTextColor . value = value ;
166- break ;
167- case AnnotationEditorParamsType . INK_COLOR :
168- updateInkColor ( value ) ;
169- break ;
170- case AnnotationEditorParamsType . INK_THICKNESS :
171- editorInkThickness . value = value ;
172- break ;
173- case AnnotationEditorParamsType . INK_OPACITY :
174- updateInkOpacity ( value ) ;
175- break ;
176- case AnnotationEditorParamsType . HIGHLIGHT_COLOR :
177- eventBus . dispatch ( "mainhighlightcolorpickerupdatecolor" , {
178- source : this ,
179- value,
180- } ) ;
181- break ;
182- case AnnotationEditorParamsType . HIGHLIGHT_THICKNESS :
183- editorFreeHighlightThickness . value = value ;
184- break ;
185- case AnnotationEditorParamsType . HIGHLIGHT_FREE :
186- editorFreeHighlightThickness . disabled = ! value ;
187- break ;
188- case AnnotationEditorParamsType . HIGHLIGHT_SHOW_ALL :
189- editorHighlightShowAll . setAttribute ( "aria-pressed" , value ) ;
190- break ;
159+ eventBus . on (
160+ "annotationeditorparamschanged" ,
161+ evt => {
162+ for ( const [ type , value ] of evt . details ) {
163+ switch ( type ) {
164+ case AnnotationEditorParamsType . FREETEXT_SIZE :
165+ editorFreeTextFontSize . value = value ;
166+ break ;
167+ case AnnotationEditorParamsType . FREETEXT_COLOR :
168+ editorFreeTextColor . value = value ;
169+ break ;
170+ case AnnotationEditorParamsType . INK_COLOR :
171+ updateInkColor ( value ) ;
172+ break ;
173+ case AnnotationEditorParamsType . INK_THICKNESS :
174+ editorInkThickness . value = value ;
175+ break ;
176+ case AnnotationEditorParamsType . INK_OPACITY :
177+ updateInkOpacity ( value ) ;
178+ break ;
179+ case AnnotationEditorParamsType . HIGHLIGHT_COLOR :
180+ eventBus . dispatch ( "mainhighlightcolorpickerupdatecolor" , {
181+ source : this ,
182+ value,
183+ } ) ;
184+ break ;
185+ case AnnotationEditorParamsType . HIGHLIGHT_THICKNESS :
186+ editorFreeHighlightThickness . value = value ;
187+ break ;
188+ case AnnotationEditorParamsType . HIGHLIGHT_FREE :
189+ editorFreeHighlightThickness . disabled = ! value ;
190+ break ;
191+ case AnnotationEditorParamsType . HIGHLIGHT_SHOW_ALL :
192+ editorHighlightShowAll . setAttribute ( "aria-pressed" , value ) ;
193+ break ;
194+ }
191195 }
192- }
193- } ) ;
196+ } ,
197+ internalOpt
198+ ) ;
194199 }
195200}
196201
0 commit comments