Skip to content

Commit

Permalink
Use the local eventBus in the AnnotationEditorUIManager constructor
Browse files Browse the repository at this point in the history
This shortens the code ever so slightly, which cannot hurt.
  • Loading branch information
Snuffleupagus committed Aug 13, 2024
1 parent 038e482 commit 8273553
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/display/editor/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -776,21 +776,13 @@ class AnnotationEditorUIManager {
this.#viewer = viewer;
this.#altTextManager = altTextManager;
this._eventBus = eventBus;
this._eventBus._on("editingaction", this.onEditingAction.bind(this), {
signal,
});
this._eventBus._on("pagechanging", this.onPageChanging.bind(this), {
signal,
});
this._eventBus._on("scalechanging", this.onScaleChanging.bind(this), {
signal,
});
this._eventBus._on("rotationchanging", this.onRotationChanging.bind(this), {
signal,
});
this._eventBus._on("setpreference", this.onSetPreference.bind(this), {
eventBus._on("editingaction", this.onEditingAction.bind(this), { signal });
eventBus._on("pagechanging", this.onPageChanging.bind(this), { signal });
eventBus._on("scalechanging", this.onScaleChanging.bind(this), { signal });
eventBus._on("rotationchanging", this.onRotationChanging.bind(this), {
signal,
});
eventBus._on("setpreference", this.onSetPreference.bind(this), { signal });
this.#addSelectionListener();
this.#addDragAndDropListeners();
this.#addKeyboardManager();
Expand Down

0 comments on commit 8273553

Please sign in to comment.