feat(ui): modals close only via Esc/X/cancel; standard 3:1 form cover processing
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
||||
import { useEscClose } from '@/lib/modal-stack';
|
||||
import TableColumnsMenu from '@/components/TableColumnsMenu.vue';
|
||||
import { RouterLink } from 'vue-router';
|
||||
import axios from 'axios';
|
||||
@@ -240,6 +241,8 @@ function closeModal() {
|
||||
modal.value = null;
|
||||
}
|
||||
|
||||
useEscClose(() => modal.value, closeModal);
|
||||
|
||||
function openSettings() {
|
||||
modal.value = 'settings';
|
||||
}
|
||||
@@ -879,7 +882,7 @@ onBeforeUnmount(() => {
|
||||
</section>
|
||||
|
||||
<Teleport to="body">
|
||||
<div v-if="modal" class="overlay" @click.self="closeModal">
|
||||
<div v-if="modal" class="overlay">
|
||||
<div class="sheet" role="dialog" aria-modal="true">
|
||||
<header>
|
||||
<h3>
|
||||
@@ -892,7 +895,7 @@ onBeforeUnmount(() => {
|
||||
<template v-else-if="modal === 'reward'">{{ editingRewardId ? 'ویرایش پاداش' : 'پاداش جدید' }}</template>
|
||||
<template v-else>ثبت پاداش</template>
|
||||
</h3>
|
||||
<button class="icon-btn" type="button" @click="closeModal"><UiIcon name="x" :size="16" /></button>
|
||||
<button class="icon-btn" type="button" aria-label="بستن (Esc)" title="بستن (Esc)" @click="closeModal"><UiIcon name="x" :size="16" /></button>
|
||||
</header>
|
||||
|
||||
<form v-if="modal === 'settings'" class="form" @submit.prevent="saveSettings">
|
||||
|
||||
Reference in New Issue
Block a user