Implemented modeSwitch listener

This commit is contained in:
Florian Bouillon 2019-11-15 11:10:45 +01:00
parent 5b11c7d7b4
commit 2569decb62
No known key found for this signature in database
GPG Key ID: B143FF27EF555D16

View File

@ -244,8 +244,9 @@ export default class FormManager {
ajax.send() ajax.send()
} }
public mode = FMMode.EditMode;
public setMode(mode: FMMode) { public setMode(mode: FMMode) {
console.log(mode) this.mode = mode
if (mode == FMMode.ViewMode) { if (mode == FMMode.ViewMode) {
for (const name in this.inputs) { for (const name in this.inputs) {
if (this.inputs.hasOwnProperty(name)) { 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) { public setModeForInput(mode: FMMode, inputName: string) {