documentatie
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user