Skip to content

Commit

Permalink
Merge pull request #27 from zipper/optional-control-element
Browse files Browse the repository at this point in the history
Optional control element
  • Loading branch information
zipper authored Nov 1, 2023
2 parents 717121c + e5b7303 commit a5a74bf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/CollapsableItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class CollapsableItem {
const controlElements = element.querySelectorAll<HTMLElement>(collapsable.options.control)
const boxElements = element.querySelectorAll<HTMLElement>(collapsable.options.box)

if (!controlElements.length || !boxElements.length) {
if (!boxElements.length) {
throw new Error(`Collapsable: Missing control or box element.'`)
}

Expand Down Expand Up @@ -295,4 +295,12 @@ declare global {
'collapsed.collapsable': CollapsableEvent
'destroy.collapsable': CustomEvent
}

interface DocumentEventMap {
'expand.collapsable': CollapsableEvent
'expanded.collapsable': CollapsableEvent
'collapse.collapsable': CollapsableEvent
'collapsed.collapsable': CollapsableEvent
'destroy.collapsable': CustomEvent
}
}

0 comments on commit a5a74bf

Please sign in to comment.