documentatie

This commit is contained in:
2026-09-03 17:24:56 +02:00
parent e971dfe942
commit 42fcea9af8
14 changed files with 135 additions and 16 deletions
@@ -17,6 +17,10 @@ export class CmapEditorUiController {
this.listeners.push(() => element.removeEventListener(event, listener));
}
/**
* Bind every standard CMap toolbar action once.
* result : This controller, so the host may retain the initialized instance.
*/
initialize() {
this.bind("#cmap-save-map", "click", () => this.actions.save?.());
this.bind("#cmap-undo", "click", (_event, editor) => editor?.undo());
@@ -47,6 +51,7 @@ export class CmapEditorUiController {
return this;
}
/** Remove every listener installed by initialize before the host is disposed. */
destroy() {
for (const remove of this.listeners) remove();
this.listeners = [];