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, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
||||
import { useEscClose } from '@/lib/modal-stack';
|
||||
import { useRoute } from 'vue-router';
|
||||
import axios from 'axios';
|
||||
import { api } from '@/lib/api';
|
||||
@@ -579,6 +580,10 @@ async function openHistory(note: NoteDto) {
|
||||
}
|
||||
}
|
||||
|
||||
useEscClose(() => editorOpen.value, () => closeEditor());
|
||||
useEscClose(() => moreSheetOpen.value, () => { moreSheetOpen.value = false; });
|
||||
useEscClose(() => historyOpen.value, () => closeHistory());
|
||||
|
||||
function closeHistory() {
|
||||
historyOpen.value = false;
|
||||
historyNoteId.value = null;
|
||||
@@ -1023,7 +1028,7 @@ onBeforeUnmount(() => {
|
||||
<!-- Unified create/edit modal -->
|
||||
<Teleport to="body">
|
||||
<div v-if="editorOpen" class="panel-root">
|
||||
<div class="panel-backdrop" @click="closeEditor" />
|
||||
<div class="panel-backdrop" aria-hidden="true" />
|
||||
<aside
|
||||
class="editor-panel"
|
||||
:style="{
|
||||
@@ -1309,7 +1314,7 @@ onBeforeUnmount(() => {
|
||||
</nav>
|
||||
|
||||
<div v-if="moreSheetOpen" class="sheet-root">
|
||||
<div class="sheet-backdrop" @click="moreSheetOpen = false" />
|
||||
<div class="sheet-backdrop" aria-hidden="true" />
|
||||
<div class="sheet">
|
||||
<header>
|
||||
<h3>جزئیات بیشتر</h3>
|
||||
@@ -1385,7 +1390,7 @@ onBeforeUnmount(() => {
|
||||
|
||||
<Teleport to="body">
|
||||
<div v-if="historyOpen" class="history-root">
|
||||
<div class="history-backdrop" @click="closeHistory" />
|
||||
<div class="history-backdrop" aria-hidden="true" />
|
||||
<aside class="history-panel" role="dialog" aria-label="تاریخچه ویرایش">
|
||||
<header class="history-head">
|
||||
<h2>تاریخچه ویرایش</h2>
|
||||
|
||||
Reference in New Issue
Block a user