mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-03 05:11:31 -05:00
restored some deleted stuff
This commit is contained in:
@@ -51,6 +51,8 @@ const routes = [
|
||||
|
||||
{path: '/ingredient-editor', component: () => import("@/pages/IngredientEditorPage.vue"), name: 'IngredientEditorPage'},
|
||||
{path: '/property-editor', component: () => import("@/pages/PropertyEditorPage.vue"), name: 'PropertyEditorPage'},
|
||||
|
||||
{path: '/space-setup', component: () => import("@/pages/SpaceSetupPage.vue"), name: 'SpaceSetupPage'},
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
|
||||
@@ -44,7 +44,7 @@ import DeleteConfirmDialog from "@/components/dialogs/DeleteConfirmDialog.vue";
|
||||
import {GenericModel} from "@/types/Models";
|
||||
import VClosableCardTitle from "@/components/dialogs/VClosableCardTitle.vue";
|
||||
import {onBeforeRouteLeave, RouteLocationNormalized} from "vue-router";
|
||||
import {ref} from "vue";
|
||||
import {onBeforeUnmount, onMounted, ref} from "vue";
|
||||
|
||||
const emit = defineEmits(['save', 'delete', 'close'])
|
||||
|
||||
@@ -60,6 +60,14 @@ const props = defineProps({
|
||||
const leaveConfirmDialog = ref(false)
|
||||
const leaveGoTo = ref<RouteLocationNormalized | null>(null)
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener("keydown", keyEvent)
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener("keydown", keyEvent)
|
||||
})
|
||||
|
||||
/**
|
||||
* before navigating to another page check for unsaved changes, if so display confirmation dialog
|
||||
*/
|
||||
@@ -84,6 +92,17 @@ function closeDialog() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* add hotkey functionality to model editor
|
||||
* @param e
|
||||
*/
|
||||
function keyEvent(e: KeyboardEvent) {
|
||||
if (e.code === "KeyS" && e.ctrlKey) {
|
||||
e.preventDefault()
|
||||
emit('save')
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@
|
||||
</v-btn-group>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-for="(s, stepIndex) in importResponse.recipe.steps" :key="i">
|
||||
<v-row v-for="(s, stepIndex) in importResponse.recipe.steps" :key="stepIndex">
|
||||
<v-col cols="12">
|
||||
<v-chip color="primary">#{{ stepIndex + 1 }}</v-chip>
|
||||
<v-btn variant="plain" size="small" icon class="float-right">
|
||||
|
||||
11
vue3/src/pages/SpaceSetupPage.vue
Normal file
11
vue3/src/pages/SpaceSetupPage.vue
Normal file
@@ -0,0 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user