This commit is contained in:
2020-09-04 18:33:25 +00:00
parent d9366c2628
commit e72bd207a0

View File

@@ -6,7 +6,7 @@
<v-col cols="12" class="d-sm-none accent--text">
<h4>{{ $ay.t("ReportEditorMobileWarning") }}</h4>
</v-col>
<v-col cols="12" sm="6" class="py-2">
<v-col cols="12" class="py-2">
<v-btn-toggle
v-model="activeTab"
tile
@@ -458,66 +458,61 @@ Handlebars.registerHelper('loud', function (aString) {
vm.editData.rawData.state = currentState;
break;
}
vm.lastTab = vm.activeTab;
//set new view stuff
switch (vm.activeTab) {
case "properties":
vm.view = "properties";
return;
break;
case "template":
editor.setModel(vm.editData.template.model);
editor.restoreViewState(vm.editData.template.state);
editor.updateOptions({ readOnly: false });
vm.view = "edit";
vm.$nextTick(() => {
editor.layout();
editor.focus();
});
break;
case "style":
editor.setModel(vm.editData.style.model);
editor.restoreViewState(vm.editData.style.state);
editor.updateOptions({ readOnly: false });
vm.view = "edit";
editor.layout();
editor.focus();
break;
case "jsPrerender":
editor.setModel(vm.editData.jsPrerender.model);
editor.restoreViewState(vm.editData.jsPrerender.state);
editor.updateOptions({ readOnly: false });
vm.view = "edit";
editor.layout();
editor.focus();
break;
case "jsHelpers":
editor.setModel(vm.editData.jsHelpers.model);
editor.restoreViewState(vm.editData.jsHelpers.state);
editor.updateOptions({ readOnly: false });
vm.view = "edit";
editor.layout();
editor.focus();
break;
case "rawData":
editor.setModel(vm.editData.rawData.model);
editor.restoreViewState(vm.editData.rawData.state);
editor.updateOptions({ readOnly: true });
vm.view = "edit";
editor.layout();
editor.focus();
break;
}
vm.lastTab = vm.activeTab;
vm.$nextTick(() => {
editor.layout();
editor.focus();
});
// vm.lastTab = vm.activeTab;
},
onResize() {
//resize related links:
//https://github.com/Microsoft/monaco-editor/issues/28
let el = document.getElementById("editContainer");
el.style = `width:100%;height:${window.innerHeight * 0.77}px`;
if (editor != null) {
editor.layout();
}
this.$nextTick(() => {
//resize related links:
//https://github.com/Microsoft/monaco-editor/issues/28
let el = document.getElementById("editContainer");
el.style = `width:100%;height:${window.innerHeight * 0.77}px`;
if (editor != null) {
editor.layout();
}
});
},
canSave: function() {
return this.formState.valid && this.formState.dirty;