Skip to content

Commit

Permalink
refactor: improve matadata editor closing behaviour
Browse files Browse the repository at this point in the history
It now matches the `refresh-metadata-dialog` behaviour
  • Loading branch information
ferferga committed Apr 28, 2023
1 parent d821b09 commit f2fa495
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/Item/ItemMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
</v-btn>
<metadata-editor-dialog
v-if="metadataDialog && item.Id"
v-model:dialog="metadataDialog"
:item-id="item.Id" />
:item-id="item.Id"
@close="metadataDialog = false" />
<refresh-metadata-dialog
v-if="refreshDialog && item.Id"
:item="menuProps.item"
Expand Down
24 changes: 12 additions & 12 deletions frontend/src/components/Item/Metadata/MetadataEditorDialog.vue
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<template>
<v-dialog
content-class="metadata-dialog"
:model-value="dialog"
:model-value="model"
:fullscreen="$vuetify.display.mobile"
@update:model-value="close">
<metadata-editor :item-id="itemId" @cancel="close" @save="close" />
@after-leave="emit('close')">
<metadata-editor
:item-id="itemId"
@cancel="model = false"
@save="model = false" />
</v-dialog>
</template>

<script setup lang="ts">
defineProps<{ dialog: boolean; itemId: string }>();
import { ref } from 'vue';
defineProps<{ itemId: string }>();
const model = ref(true);
const emit = defineEmits<{
(e: 'update:dialog', isOpen: boolean): void;
(e: 'close'): void;
}>();
/**
* Close the dialog
*/
function close(): void {
emit('update:dialog', false);
}
</script>

<style lang="scss" scoped>
Expand Down

0 comments on commit f2fa495

Please sign in to comment.