add setAction/clearAction to sidebar store for dynamic header buttons
This commit is contained in:
parent
cc2b2c1f95
commit
000cfd2332
1 changed files with 18 additions and 0 deletions
|
|
@ -99,6 +99,24 @@ class SidebarStore {
|
|||
}
|
||||
}
|
||||
|
||||
/** Update the right accessory action button dynamically */
|
||||
setAction(
|
||||
onsave: (() => void) | undefined,
|
||||
saveLabel?: string,
|
||||
element?: 'wind' | 'fire' | 'water' | 'earth' | 'dark' | 'light'
|
||||
) {
|
||||
this.state.onsave = onsave
|
||||
this.state.saveLabel = saveLabel
|
||||
this.state.element = element
|
||||
}
|
||||
|
||||
/** Clear the right accessory action button */
|
||||
clearAction() {
|
||||
this.state.onsave = undefined
|
||||
this.state.saveLabel = undefined
|
||||
this.state.element = undefined
|
||||
}
|
||||
|
||||
get isOpen() {
|
||||
return this.state.open
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue