Skip to content

Commit

Permalink
Refactor code: use .append() for adding multiple elements
Browse files Browse the repository at this point in the history
  • Loading branch information
ollimeier committed Feb 6, 2025
1 parent d6ef3ee commit 2f17509
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/fontra/views/fontinfo/panel-sources.js
Original file line number Diff line number Diff line change
Expand Up @@ -683,28 +683,22 @@ class SourceBox extends HTMLElement {
this.append(
html.div({ class: "fontra-ui-font-info-sources-panel-header" }, [
getLabelFromKey("general"),
])
]),
buildElement(this.controllers.general)
);
this.append(buildElement(this.controllers.general));

// Don't add 'Location', if the font has no axes.
if (this.fontAxesSourceSpace.length > 0) {
this.append(
html.div({ class: "fontra-ui-font-info-sources-panel-header" }, [
getLabelFromKey("location"),
])
);
this.append(
]),
buildElementLocations(this.controllers.location, this.fontAxesSourceSpace)
);
}

this.append(
html.div({ class: "fontra-ui-font-info-sources-panel-header" }, [
getLabelFromKey("lineMetricsHorizontalLayout"),
])
);
this.append(
]),
buildElementLineMetricsHor(this.controllers.lineMetricsHorizontalLayout)
);
}
Expand Down

0 comments on commit 2f17509

Please sign in to comment.