Skip to content

Commit

Permalink
Use "glyph-search" panel instead of adding glyphsSearch to editorCont…
Browse files Browse the repository at this point in the history
…roller
  • Loading branch information
ollimeier committed Oct 31, 2024
1 parent f32ee00 commit a0a66e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/fontra/views/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2838,7 +2838,8 @@ export class EditorController {
}

async doSelectPreviousNextGlyph(selectPrevious) {
const filteredGlyphItems = this.glyphsSearch.filteredGlyphItems;
const panel = this.getSidebarPanel("glyph-search");
const filteredGlyphItems = panel.glyphsSearch.filteredGlyphItems;
const glyphNames = filteredGlyphItems.map((x) => x.glyphName);

const selectedGlyphName = this.sceneSettings.selectedGlyphName;
Expand Down
9 changes: 4 additions & 5 deletions src/fontra/views/editor/panel-glyph-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ export default class GlyphSearchPanel extends Panel {

constructor(editorController) {
super(editorController);
const glyphsSearch = this.contentElement.querySelector("#glyphs-search");
editorController.glyphsSearch = glyphsSearch;
glyphsSearch.addEventListener("selectedGlyphNameChanged", (event) =>
this.glyphsSearch = this.contentElement.querySelector("#glyphs-search");
this.glyphsSearch.addEventListener("selectedGlyphNameChanged", (event) =>
this.glyphNameChangedCallback(event.detail)
);
this.editorController.fontController.addChangeListener({ glyphMap: null }, () => {
glyphsSearch.updateGlyphNamesListContent();
this.glyphsSearch.updateGlyphNamesListContent();
});
this.editorController.fontController.ensureInitialized.then(() => {
glyphsSearch.glyphMap = this.editorController.fontController.glyphMap;
this.glyphsSearch.glyphMap = this.editorController.fontController.glyphMap;
});
}

Expand Down

0 comments on commit a0a66e6

Please sign in to comment.