Merge pull request #17388 from calixteman/no_double_color_picker

[Editor] Avoid to have a color picker for highlighting twice in the main toolbar
This commit is contained in:
calixteman 2023-12-06 16:29:33 +01:00 committed by GitHub
commit f54cfe065a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,12 +121,17 @@ class Toolbar {
this.#bindListeners(options);
if (options.editorHighlightColorPicker) {
this.eventBus._on("annotationeditoruimanager", ({ uiManager }) => {
this.#setAnnotationEditorUIManager(
uiManager,
options.editorHighlightColorPicker
);
});
this.eventBus._on(
"annotationeditoruimanager",
({ uiManager }) => {
this.#setAnnotationEditorUIManager(
uiManager,
options.editorHighlightColorPicker
);
},
// Once the color picker has been added, we don't want to add it again.
{ once: true }
);
}
this.reset();