Skip to content

Commit

Permalink
add unsaved changes to new scripts and close and cancel buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
sadnub committed Nov 29, 2023
1 parent e06b7a7 commit 69414d4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/components/scripts/ScriptFormModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
@click="generateScriptOpenAI"
/>
<q-space />
<q-btn dense flat icon="close" v-close-popup>
<q-btn dense flat icon="close" @click="closeEditor">
<q-tooltip class="bg-white text-primary">Close</q-tooltip>
</q-btn>
</q-bar>
Expand Down Expand Up @@ -192,7 +192,7 @@
</template>
</tactical-dropdown>
<q-space />
<q-btn dense flat label="Cancel" v-close-popup />
<q-btn dense flat label="Cancel" @click="closeEditor" />
<q-btn
v-if="!readonly"
:loading="loading"
Expand Down Expand Up @@ -366,13 +366,22 @@ function loadEditor() {
script.script_body = r.code;
editor.setValue(r.code);
// need to add this in the download function otherwise the above will trigger an edit
watch(
() => script.script_body,
() => {
edited.value = true;
},
);
});
else {
watch(
() => script.script_body,
() => {
edited.value = true;
},
);
}
// watch for changes in language
watch(lang, () => {
Expand Down

0 comments on commit 69414d4

Please sign in to comment.