From 2569decb62e6ba6cc4b99b34a8639d737c361e29 Mon Sep 17 00:00:00 2001 From: Avior Date: Fri, 15 Nov 2019 11:10:45 +0100 Subject: [PATCH] Implemented modeSwitch listener --- src/FormManager.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/FormManager.ts b/src/FormManager.ts index 047faae..85fa0ff 100644 --- a/src/FormManager.ts +++ b/src/FormManager.ts @@ -244,8 +244,9 @@ export default class FormManager { ajax.send() } + public mode = FMMode.EditMode; public setMode(mode: FMMode) { - console.log(mode) + this.mode = mode if (mode == FMMode.ViewMode) { for (const name in this.inputs) { if (this.inputs.hasOwnProperty(name)) { @@ -263,6 +264,7 @@ export default class FormManager { } } + this.attributeManager.trigger(AttributeListeners.MODE_SWITCH, mode) } public setModeForInput(mode: FMMode, inputName: string) {