fix: keep list menus on screen and clip long activity subtitles
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, onUnmounted, ref, watch } from 'vue';
|
||||
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue';
|
||||
import { RouterLink, useRoute, useRouter } from 'vue-router';
|
||||
import axios from 'axios';
|
||||
import { api } from '@/lib/api';
|
||||
@@ -661,7 +661,11 @@ async function confirmDeleteActivities() {
|
||||
|
||||
function onBoardMenu(activityId: string) {
|
||||
boardMenuId.value = boardMenuId.value === activityId ? null : activityId;
|
||||
boardMenuStyle.value = boardMenuId.value ? cardMenuStyle(activityId) : null;
|
||||
boardMenuStyle.value = null;
|
||||
if (!boardMenuId.value) return;
|
||||
void nextTick(() => {
|
||||
boardMenuStyle.value = cardMenuStyle(activityId);
|
||||
});
|
||||
}
|
||||
|
||||
const unbindBoardMenuDismiss = bindMenuDismiss(
|
||||
@@ -1332,38 +1336,40 @@ onUnmounted(() => {
|
||||
/>
|
||||
</template>
|
||||
|
||||
<div
|
||||
v-if="boardMenuId"
|
||||
class="menu-pop"
|
||||
role="menu"
|
||||
:style="boardMenuStyle ?? undefined"
|
||||
@click.stop
|
||||
>
|
||||
<button type="button" role="menuitem" @click="startSelect(boardMenuId)">انتخاب</button>
|
||||
<RouterLink
|
||||
role="menuitem"
|
||||
:to="{ name: 'activity-detail', params: { id: boardMenuId } }"
|
||||
@click="boardMenuId = null"
|
||||
<Teleport to="body">
|
||||
<div
|
||||
v-if="boardMenuId"
|
||||
class="menu-pop"
|
||||
role="menu"
|
||||
:style="boardMenuStyle ?? undefined"
|
||||
@click.stop
|
||||
>
|
||||
مشاهده
|
||||
</RouterLink>
|
||||
<RouterLink
|
||||
role="menuitem"
|
||||
:to="{ name: 'activity-edit', params: { id: boardMenuId } }"
|
||||
@click="boardMenuId = null"
|
||||
>
|
||||
ویرایش
|
||||
</RouterLink>
|
||||
<button
|
||||
type="button"
|
||||
role="menuitem"
|
||||
class="danger"
|
||||
@click="askDeleteActivity(boardMenuId)"
|
||||
>
|
||||
حذف
|
||||
</button>
|
||||
<button type="button" role="menuitem" @click="boardMenuId = null">بستن</button>
|
||||
</div>
|
||||
<button type="button" role="menuitem" @click="startSelect(boardMenuId)">انتخاب</button>
|
||||
<RouterLink
|
||||
role="menuitem"
|
||||
:to="{ name: 'activity-detail', params: { id: boardMenuId } }"
|
||||
@click="boardMenuId = null"
|
||||
>
|
||||
مشاهده
|
||||
</RouterLink>
|
||||
<RouterLink
|
||||
role="menuitem"
|
||||
:to="{ name: 'activity-edit', params: { id: boardMenuId } }"
|
||||
@click="boardMenuId = null"
|
||||
>
|
||||
ویرایش
|
||||
</RouterLink>
|
||||
<button
|
||||
type="button"
|
||||
role="menuitem"
|
||||
class="danger"
|
||||
@click="askDeleteActivity(boardMenuId)"
|
||||
>
|
||||
حذف
|
||||
</button>
|
||||
<button type="button" role="menuitem" @click="boardMenuId = null">بستن</button>
|
||||
</div>
|
||||
</Teleport>
|
||||
|
||||
<UiModal
|
||||
:open="Boolean(activityModal)"
|
||||
@@ -1887,17 +1893,29 @@ h1 {
|
||||
display: flex;
|
||||
gap: 0.55rem;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.title-cell > div {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.star {
|
||||
color: #cbd5e1;
|
||||
margin-top: 0.2rem;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.title {
|
||||
display: block;
|
||||
color: inherit;
|
||||
font-weight: 600;
|
||||
overflow-wrap: anywhere;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.sub {
|
||||
@@ -2148,9 +2166,7 @@ time.note {
|
||||
|
||||
.menu-pop {
|
||||
position: fixed;
|
||||
inset-inline-start: 1rem;
|
||||
bottom: calc(var(--mobile-tabbar-h, 0px) + 1.75rem);
|
||||
z-index: 40;
|
||||
z-index: 80;
|
||||
background: #fff;
|
||||
border: 1px solid var(--line, #e2e8f0);
|
||||
border-radius: var(--radius);
|
||||
|
||||
Reference in New Issue
Block a user