fix(notes): keep the card menu above the grid
The menu was clipped by the card, so the lower actions disappeared under the next row. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import NoteCategoriesManager from '@/components/notes/NoteCategoriesManager.vue'
|
|||||||
import JalaliDateInput from '@/components/JalaliDateInput.vue';
|
import JalaliDateInput from '@/components/JalaliDateInput.vue';
|
||||||
import VoiceToTextButton from '@/components/VoiceToTextButton.vue';
|
import VoiceToTextButton from '@/components/VoiceToTextButton.vue';
|
||||||
import UiIcon from '@/components/UiIcon.vue';
|
import UiIcon from '@/components/UiIcon.vue';
|
||||||
|
import { UiDropdownMenu } from '@/components/ui';
|
||||||
import { appendSpokenText } from '@/lib/spoken-text';
|
import { appendSpokenText } from '@/lib/spoken-text';
|
||||||
import { canManageSettings } from '@/lib/roles';
|
import { canManageSettings } from '@/lib/roles';
|
||||||
import { useAuthStore } from '@/stores/auth';
|
import { useAuthStore } from '@/stores/auth';
|
||||||
@@ -721,7 +722,7 @@ function syncMobileFlag() {
|
|||||||
|
|
||||||
function onDocClick(ev: MouseEvent) {
|
function onDocClick(ev: MouseEvent) {
|
||||||
const t = ev.target as HTMLElement | null;
|
const t = ev.target as HTMLElement | null;
|
||||||
if (!t?.closest?.('.card-menu')) menuOpenId.value = null;
|
if (!t?.closest?.('.card-menu, .ui-dd-panel')) menuOpenId.value = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(typeFilter, () => {
|
watch(typeFilter, () => {
|
||||||
@@ -962,27 +963,34 @@ onBeforeUnmount(() => {
|
|||||||
</svg>
|
</svg>
|
||||||
</span>
|
</span>
|
||||||
<div class="card-menu" @click.stop>
|
<div class="card-menu" @click.stop>
|
||||||
<button
|
<UiDropdownMenu
|
||||||
type="button"
|
:open="menuOpenId === note.id"
|
||||||
class="icon-btn menu-btn"
|
align="end"
|
||||||
@click="menuOpenId = menuOpenId === note.id ? null : note.id"
|
@update:open="(v) => (menuOpenId = v ? note.id : null)"
|
||||||
>
|
>
|
||||||
<UiIcon name="dots-v" :size="18" />
|
<template #trigger="{ toggle }">
|
||||||
</button>
|
<button
|
||||||
<div v-if="menuOpenId === note.id" class="menu-pop">
|
type="button"
|
||||||
<button type="button" @click="openEditor('default', note)">ویرایش</button>
|
class="icon-btn menu-btn"
|
||||||
<button type="button" @click="togglePin(note.id)">
|
aria-label="عملیات"
|
||||||
|
@click.stop="toggle"
|
||||||
|
>
|
||||||
|
<UiIcon name="dots-v" :size="18" />
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
<button type="button" @click.stop="openEditor('default', note)">ویرایش</button>
|
||||||
|
<button type="button" @click.stop="togglePin(note.id)">
|
||||||
{{ note.pinned ? 'برداشتن سنجاق' : 'سنجاق کردن' }}
|
{{ note.pinned ? 'برداشتن سنجاق' : 'سنجاق کردن' }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
v-if="(note.revisionCount ?? 0) > 0"
|
v-if="(note.revisionCount ?? 0) > 0"
|
||||||
type="button"
|
type="button"
|
||||||
@click="openHistory(note)"
|
@click.stop="openHistory(note)"
|
||||||
>
|
>
|
||||||
تاریخچه ویرایش
|
تاریخچه ویرایش
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="danger" @click="removeNote(note.id)">حذف</button>
|
<button type="button" class="danger" @click.stop="removeNote(note.id)">حذف</button>
|
||||||
</div>
|
</UiDropdownMenu>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -1893,36 +1901,6 @@ onBeforeUnmount(() => {
|
|||||||
position: relative;
|
position: relative;
|
||||||
margin-inline-start: auto;
|
margin-inline-start: auto;
|
||||||
}
|
}
|
||||||
.menu-pop {
|
|
||||||
position: absolute;
|
|
||||||
inset-inline-end: 0;
|
|
||||||
top: 100%;
|
|
||||||
z-index: 5;
|
|
||||||
background: #fff;
|
|
||||||
border: 1px solid #e2e8f0;
|
|
||||||
border-radius: var(--radius);
|
|
||||||
box-shadow: var(--shadow);
|
|
||||||
min-width: 140px;
|
|
||||||
padding: 0.25rem;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.menu-pop button {
|
|
||||||
border: 0;
|
|
||||||
background: transparent;
|
|
||||||
text-align: start;
|
|
||||||
padding: 0.45rem 0.65rem;
|
|
||||||
border-radius: var(--radius);
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 0.85rem;
|
|
||||||
color: #334155;
|
|
||||||
}
|
|
||||||
.menu-pop button:hover {
|
|
||||||
background: #f8fafc;
|
|
||||||
}
|
|
||||||
.menu-pop .danger {
|
|
||||||
color: #dc2626;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-title {
|
.card-title {
|
||||||
margin: 0 0 0.35rem;
|
margin: 0 0 0.35rem;
|
||||||
|
|||||||
Reference in New Issue
Block a user