Skip to content

Commit

Permalink
Merge pull request mozilla#17388 from calixteman/no_double_color_picker
Browse files Browse the repository at this point in the history
[Editor] Avoid to have a color picker for highlighting twice in the main toolbar
  • Loading branch information
calixteman authored Dec 6, 2023
2 parents a692f86 + cb9c855 commit f54cfe0
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions web/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f54cfe0

Please sign in to comment.