From 043ef6f44cffa9f23d742e47163ee21c1a1ac7aa Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 1 Sep 2020 22:31:00 +0000 Subject: [PATCH] --- ayanova/src/views/ay-report-edit.vue | 31 ++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/ayanova/src/views/ay-report-edit.vue b/ayanova/src/views/ay-report-edit.vue index e43e5522..2cb08ead 100644 --- a/ayanova/src/views/ay-report-edit.vue +++ b/ayanova/src/views/ay-report-edit.vue @@ -214,6 +214,29 @@ export default { }); //save the initial state because we're going to move away from it immediately vm.editData.template.state = editor.saveViewState(); + + //change subscription + editor.onDidChangeModelContent(event => { + const editorValue = editor.getValue(); + // console.log("editorchange active tab=", vm.activeTab); + // console.log("editorchange, value of editor is", editorValue); + switch (vm.activeTab) { + case "template": + vm.obj.template = editorValue; + break; + case "style": + vm.obj.style = editorValue; + break; + case "jsPrerender": + vm.obj.jsPrerender = editorValue; + break; + case "jsHelpers": + vm.obj.jsHelpers = editorValue; + break; + } + vm.formState.dirty = true; + }); + vm.showEditor = false; //--------------- @@ -280,11 +303,11 @@ export default { obj: { id: 0, concurrency: 0, - name: null, - active: null, - notes: null, + name: "report", + active: true, + notes: "", roles: null, - objectType: 0, + objectType: 124927, //all except customers template: `console.log('hello world');`, style: `.example { color: blue;