Skip to content

Commit

Permalink
Merge pull request #189 from ator-dev/toolbar-empty-insert-fix
Browse files Browse the repository at this point in the history
Insert toolbar even when there are no terms
  • Loading branch information
ator-dev authored Sep 28, 2024
2 parents 05fde23 + 06ffbc1 commit c50f2ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/content.mts
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ interface TermAppender<Async = true> {
getToolbarOrNull()?.remove();
}
if (message.terms) {
// Ensure the toolbar is set up.
getToolbar().insertAdjacentTo(document.body, "beforebegin");
// TODO make sure same MatchTerm objects are used for terms which are equivalent
termSetterInternal.setTerms(message.terms);
}
Expand Down
1 change: 1 addition & 0 deletions src/modules/interface/toolbar.mts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class Toolbar implements AbstractToolbar, ToolbarTermControlInterface, ToolbarCo
this.#highlighter = highlighter;
this.#barContainer = document.createElement("div");
this.#barContainer.id = CommonEleID.BAR;
this.#barContainer.style.cssText = "all: revert !important;";
const shadowRoot = this.#barContainer.attachShadow({
mode: "closed",
delegatesFocus: false,
Expand Down

0 comments on commit c50f2ce

Please sign in to comment.