Skip to content

Commit f54cfe0

Browse files
authored
Merge pull request #17388 from calixteman/no_double_color_picker
[Editor] Avoid to have a color picker for highlighting twice in the main toolbar
2 parents a692f86 + cb9c855 commit f54cfe0

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

web/toolbar.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,17 @@ class Toolbar {
121121
this.#bindListeners(options);
122122

123123
if (options.editorHighlightColorPicker) {
124-
this.eventBus._on("annotationeditoruimanager", ({ uiManager }) => {
125-
this.#setAnnotationEditorUIManager(
126-
uiManager,
127-
options.editorHighlightColorPicker
128-
);
129-
});
124+
this.eventBus._on(
125+
"annotationeditoruimanager",
126+
({ uiManager }) => {
127+
this.#setAnnotationEditorUIManager(
128+
uiManager,
129+
options.editorHighlightColorPicker
130+
);
131+
},
132+
// Once the color picker has been added, we don't want to add it again.
133+
{ once: true }
134+
);
130135
}
131136

132137
this.reset();

0 commit comments

Comments
 (0)