Skip to content

Commit

Permalink
fix: Handle invalid 'filter.connectInput' option in FilterExtension c…
Browse files Browse the repository at this point in the history
…lass
  • Loading branch information
mar10 committed Jul 6, 2024
1 parent 8600018 commit 864ed29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/wb_ext_filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class FilterExtension extends WunderbaumExtension<FilterOptionsType> {
const connectInput = this.getPluginOption("connectInput");
if (connectInput) {
this.queryInput = elemFromSelector(connectInput) as HTMLInputElement;
assert(this.queryInput, `Invalid 'filter.connectInput' option: ${connectInput}.`);
onEvent(
this.queryInput,
"input",
Expand Down
4 changes: 4 additions & 0 deletions src/wunderbaum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2242,6 +2242,10 @@ export class Wunderbaum {
}

if (this.options.connectTopBreadcrumb) {
util.assert(
this.options.connectTopBreadcrumb.textContent,
`Invalid 'connectTopBreadcrumb' option (input element expected).`
);
let path = this.getTopmostVpNode(true)?.getPath(false, "title", " > ");
path = path ? path + " >" : "";
this.options.connectTopBreadcrumb.textContent = path;
Expand Down

0 comments on commit 864ed29

Please sign in to comment.