feat: add selectable check modifiers
This commit is contained in:
parent
d4945cf230
commit
82217dd971
8 changed files with 174 additions and 51 deletions
20
src/apps/dialog-with-listeners.ts
Normal file
20
src/apps/dialog-with-listeners.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
// SPDX-FileCopyrightText: 2022 Johannes Loher
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/**
|
||||
* A simple extension to the {@link Dialog} class that allows attaching additional listeners.
|
||||
*/
|
||||
export class DialogWithListeners extends Dialog<DialogWithListenersOptions> {
|
||||
/** @inheritdoc */
|
||||
activateListeners(html: JQuery): void {
|
||||
super.activateListeners(html);
|
||||
if (this.options.activateAdditionalListeners !== undefined) {
|
||||
this.options.activateAdditionalListeners(html, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface DialogWithListenersOptions extends DialogOptions {
|
||||
activateAdditionalListeners?: ((html: JQuery, app: DialogWithListeners) => void) | undefined;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue