forgot to stage these

This commit is contained in:
Thomas 2022-04-09 17:31:11 -05:00
parent ad750a8959
commit 14960831b4
2 changed files with 17 additions and 10 deletions

View File

@ -12,7 +12,7 @@ import { ref } from "vue";
</script> </script>
<template> <template>
<q-layout view="hHh Lpr fff"> <q-layout view="hHr LpR fFf">
<q-header elevated class="bg-primary text-white" height-hint="98"> <q-header elevated class="bg-primary text-white" height-hint="98">
<q-toolbar> <q-toolbar>
<q-toolbar-title> <q-toolbar-title>
@ -26,6 +26,7 @@ import { ref } from "vue";
<q-tabs align="left"> <q-tabs align="left">
<q-route-tab to="/Scratch" label="Scratch" /> <q-route-tab to="/Scratch" label="Scratch" />
<q-route-tab to="/Editor" label="Editor" /> <q-route-tab to="/Editor" label="Editor" />
</q-tabs> </q-tabs>
</q-header> </q-header>

View File

@ -21,11 +21,17 @@ const richTextStatments = ref([
const richEditModal = ref(false); const richEditModal = ref(false);
const richEditExpression = ref(""); const richEditExpression = ref("");
const richEditStatement = (stmt: String) => { const richEditID = ref(0);
console.log('editing statement', stmt, editModal)
activeStatement = stmt const richEditStatement = (id: int) => {
richEditModal.value = true console.log("editing statement", id, richEditModal);
richEditExpression.value = stmt.raw richEditModal.value = true;
richEditID.value = id;
richEditExpression.value = richTextStatments.value[richEditID.value].text;
};
function richUpdateValue() {
richTextStatments.value[richEditID.value].text = richEditExpression.value;
} }
</script> </script>
@ -61,19 +67,19 @@ const richEditStatement = (stmt: String) => {
</q-drawer> </q-drawer>
<q-page-container id="editor" style="display: flex"> <q-page-container id="editor" style="display: flex">
<q-dialog ref="edit-modal" v-model="richEditModal"> <q-dialog v-model="richEditModal">
<q-card> <q-card>
<q-editor v-model="richEditExpression" min-height="5rem" />
<q-card-actions align="right" class="text-primary"> <q-card-actions align="right" class="text-primary">
<q-btn flat label="Cancel" v-close-popup></q-btn> <q-btn flat label="Cancel" v-close-popup></q-btn>
<q-btn flat label="Save" v-close-popup></q-btn> <q-btn flat label="Save" @click="richUpdateValue" v-close-popup></q-btn>
</q-card-actions> </q-card-actions>
</q-card> </q-card>
</q-dialog> </q-dialog>
<span v-for="(item, index) in richTextStatments"> <span v-for="(item, index) in richTextStatments">
<TextBox <TextBox
:statement="item.text" :statement="item.text"
v-on:edit="() => (stmt ? richEditStatement(stmt) : {})" v-on:edit="() => (item.text ? richEditStatement(index) : {})"
></TextBox> ></TextBox>
</span> </span>
</q-page-container> </q-page-container>