Skip to content

A self-hosted media server and file management system

fix: popover overflows, its arrow is not positioned correctly and it does not change direction based on available space

aminnausinaa3bd565765d
diff --git a/resources/js/components/cards/data/LibraryCard.vue b/resources/js/components/cards/data/LibraryCard.vue
index c9b30ef2..cdac5140 100644
--- a/resources/js/components/cards/data/LibraryCard.vue
+++ b/resources/js/components/cards/data/LibraryCard.vue
@@ -171,7 +171,7 @@ watch(
<ButtonIcon :title="'Open Default Folder In New Tab'" :to="`/${data?.name}`" :target="'_blank'" class="size-6 p-0">
<template #icon><CircumShare1 class="size-4" /></template>
</ButtonIcon>
- <BasePopover popoverClass="max-w-56! rounded-lg mt-8" :buttonClass="'p-1! ml-auto'" ref="popover">
+ <BasePopover popoverClass="max-w-50 lg:max-w-56 rounded-lg" :buttonClass="'p-1'" ref="popover">
<template #buttonIcon>
<ProiconsMoreVertical class="size-4" />
</template>
diff --git a/resources/js/components/cards/data/LibraryFolderCard.vue b/resources/js/components/cards/data/LibraryFolderCard.vue
index 01cab14b..129dd8ad 100644
--- a/resources/js/components/cards/data/LibraryFolderCard.vue
+++ b/resources/js/components/cards/data/LibraryFolderCard.vue
@@ -93,7 +93,7 @@ const handleToggleDownloads = async (id: number, currentValue: boolean) => {
<ButtonIcon :title="'Open Folder In New Tab'" :to="`/${encodeURI(data.path)}`" :target="'_blank'" class="size-6 p-0">
<template #icon><CircumShare1 class="size-4" /></template>
</ButtonIcon>
- <BasePopover popoverClass="max-w-56! rounded-lg mt-8" :buttonClass="'p-1! ml-auto'" ref="popover">
+ <BasePopover popoverClass="max-w-48 lg:max-w-56 rounded-lg" :buttonClass="'p-1'" ref="popover">
<template #buttonIcon>
<ProiconsMoreVertical class="size-4" />
</template>
diff --git a/resources/js/components/cards/data/TaskCard.vue b/resources/js/components/cards/data/TaskCard.vue
index 4d95894d..d999a403 100644
--- a/resources/js/components/cards/data/TaskCard.vue
+++ b/resources/js/components/cards/data/TaskCard.vue
@@ -204,20 +204,19 @@ watch(
</span>
<BasePopover
ref="popover"
- popoverClass="w-40! rounded-lg mt-8"
+ popoverClass="max-w-40 rounded-lg"
:buttonComponent="ButtonIcon"
:button-attributes="{
class: 'hocus:dark:bg-surface-1 hocus:bg-surface-6 hover:text-primary dark:hover:text-primary-muted size-6 rounded-xl p-1',
variant: 'ghost',
label: 'Manage Permissions',
}"
- @click.stop="() => {}"
>
<template #buttonIcon>
<ProiconsMoreVertical class="size-5" />
</template>
<template #content>
- <div class="grid gap-2">
+ <div class="grid gap-2 text-xs">
<h4 class="text-sm font-medium">Manage Task</h4>
<ButtonText variant="form" title="Run Again" class="justify-between px-2 dark:bg-neutral-950" disabled>
diff --git a/resources/js/components/cards/data/UserCard.vue b/resources/js/components/cards/data/UserCard.vue
index 58444862..43b9241e 100644
--- a/resources/js/components/cards/data/UserCard.vue
+++ b/resources/js/components/cards/data/UserCard.vue
@@ -33,7 +33,7 @@ const props = defineProps<{ data: UserResource }>();
<div class="flex flex-1 justify-end gap-1">
<BasePopover
- popoverClass="w-64! rounded-lg "
+ popoverClass="max-w-48 rounded-lg"
:buttonComponent="ButtonCorner"
:button-attributes="{
positionClasses: 'size-7 p-1! ml-auto sm:hidden',
@@ -46,28 +46,26 @@ const props = defineProps<{ data: UserResource }>();
<ProiconsMoreVertical class="size-4" />
</template>
<template #content>
- <div class="grid gap-4">
- <h4 class="leading-none font-medium">Manage User</h4>
+ <div class="grid gap-2 text-xs">
+ <h4 class="text-sm font-medium">Manage User</h4>
- <div class="grid gap-2">
- <ButtonText class="justify-between dark:bg-neutral-950" title="Scan for Folder Changes" to="/profile">
- View Profile
- <template #icon> <ProiconsPersonCircle class="size-4" /></template>
- </ButtonText>
- <ButtonText class="justify-between dark:bg-neutral-950" title="Set User Access Permissions" disabled>
- Manage Permissions
- <template #icon> <ProiconsLockOpen class="size-4" /></template>
- </ButtonText>
- <ButtonText
- class="text-danger dark:text-foreground-0 dark:bg-danger-3 dark:hocus:bg-danger justify-between"
- title="Remove User From Server"
- @click.stop.prevent="$emit('clickAction')"
- disabled
- >
- Remove User
- <template #icon> <ProiconsDelete class="size-4" /></template>
- </ButtonText>
- </div>
+ <ButtonText class="justify-between dark:bg-neutral-950" title="Scan for Folder Changes" to="/profile">
+ View Profile
+ <template #icon> <ProiconsPersonCircle class="size-4" /></template>
+ </ButtonText>
+ <ButtonText class="justify-between dark:bg-neutral-950" title="Set User Access Permissions" disabled>
+ Manage Permissions
+ <template #icon> <ProiconsLockOpen class="size-4" /></template>
+ </ButtonText>
+ <ButtonText
+ class="text-danger dark:text-foreground-0 dark:bg-danger-3 dark:hocus:bg-danger justify-between"
+ title="Remove User From Server"
+ @click.stop.prevent="$emit('clickAction')"
+ disabled
+ >
+ Remove User
+ <template #icon> <ProiconsDelete class="size-4" /></template>
+ </ButtonText>
</div>
</template>
</BasePopover>
diff --git a/resources/js/components/cedar-ui/popover/BasePopover.vue b/resources/js/components/cedar-ui/popover/BasePopover.vue
index 78b1f989..dd337e6a 100644
--- a/resources/js/components/cedar-ui/popover/BasePopover.vue
+++ b/resources/js/components/cedar-ui/popover/BasePopover.vue
@@ -2,10 +2,10 @@
import type { Component, ComponentPublicInstance } from 'vue';
import { computed, nextTick, onMounted, onUnmounted, ref, useTemplateRef, watch } from 'vue';
-import { OnClickOutside } from '@vueuse/components';
+import { onClickOutside } from '@vueuse/core';
import { UseFocusTrap } from '@vueuse/integrations/useFocusTrap/component';
-import { CedarOptions } from '../icons';
-import { ButtonText } from '../button';
+import { CedarOptions } from '@/components/cedar-ui/icons';
+import { ButtonText } from '@/components/cedar-ui/button';
import { cn } from '@aminnausin/cedar-ui';
const props = withDefaults(
@@ -15,84 +15,88 @@ const props = withDefaults(
popoverClass?: string;
buttonComponent?: Component;
buttonAttributes?: { [key: string]: any };
- verticalOffsetPixels?: number;
hideDefaultIcon?: boolean;
forcePopoverPosition?: 'top' | 'bottom';
showPopoverArrow?: boolean;
+ teleportDisabled?: boolean;
+ teleportTarget?: string;
+ scrollContainer?: 'body' | 'window';
+ marginY?: number;
+ marginX?: number;
}>(),
{
disabled: false,
buttonComponent: ButtonText,
hideDefaultIcon: false,
showPopoverArrow: true,
+ teleportDisabled: false,
+ teleportTarget: 'body',
+ scrollContainer: 'body',
+ marginY: 8,
+ marginX: 8,
},
);
const popoverOpen = ref(false);
-const popoverPosition = ref<'top' | 'bottom'>('bottom');
-const popoverAdjustment = ref('');
-const popoverHeight = ref(0);
-const popoverOffset = ref(8);
+const popoverStyles = ref<Record<string, string>>({});
+const popoverDirection = ref<'top' | 'bottom'>('bottom');
+const arrowStyles = ref<Record<string, string>>({});
const popover = useTemplateRef('popover');
+const popoverArrow = useTemplateRef('popoverArrowRef');
const popoverButton = useTemplateRef<ComponentPublicInstance>('popoverButton');
-const popoverArrowRef = useTemplateRef('popoverArrowRef');
-
-const resizeTimeout = ref<null | number>(null);
const mergedButtonAttributes = computed(() => ({
title: 'Open Menu',
...props.buttonAttributes,
}));
-async function popoverHeightCalculate() {
- if (!popover.value) return;
- popover.value.$el.classList.add('invisible');
- popoverOpen.value = true;
-
- await nextTick();
- popoverHeight.value = popover.value.$el.offsetHeight;
- popoverOpen.value = false;
- popover.value.$el.classList.remove('invisible');
- popoverPositionCalculate();
-}
-
-function popoverPositionCalculate() {
- if (!popoverButton.value) return;
-
- popoverPosition.value =
- (props.forcePopoverPosition ??
- window.innerHeight < popoverButton.value.$el.getBoundingClientRect().top + popoverButton.value.$el.offsetHeight + popoverOffset.value + popoverHeight.value)
- ? 'top'
- : 'bottom';
-}
+const init = ref(false);
+const maxWidth = ref(0);
+const maxHeight = ref(0);
const adjustPopoverPosition = () => {
- if (!popover.value || !popoverButton.value) return;
- const margin = 40;
- let adjustment = 0;
+ if (!popover.value?.$el || !popoverButton.value?.$el) return;
+
+ const [scrollX, scrollY] = props.scrollContainer === 'body' ? [document.body.scrollLeft, document.body.scrollTop] : [window.scrollX, window.scrollY];
+ const buttonRect = popoverButton.value.$el.getBoundingClientRect();
const popoverRect = popover.value.$el.getBoundingClientRect();
- const viewportWidth = window.innerWidth;
- if (viewportWidth > popoverRect.width + margin * 2 && viewportWidth - popoverRect.right - margin < 0) {
- adjustment = viewportWidth - popoverRect.right - margin;
- } else if (viewportWidth > popoverRect.width + margin * 2 && popoverRect.left <= margin) {
- adjustment = margin * 2;
+ maxWidth.value = Math.max(popoverRect.width, maxWidth.value);
+ maxHeight.value = Math.max(popoverRect.height, maxHeight.value);
+
+ if (!props.forcePopoverPosition) {
+ const spaceBelow = window.innerHeight - buttonRect.bottom - props.marginY;
+ const spaceAbove = buttonRect.top - props.marginY;
+ popoverDirection.value = spaceBelow < maxHeight.value && spaceAbove >= maxHeight.value ? 'top' : 'bottom';
}
- popover.value.$el.style = `left: ${adjustment}px; margin-${popoverPosition.value === 'bottom' ? 'top' : 'bottom'}: ${props.verticalOffsetPixels ?? 32}px;`;
- if (popoverArrowRef.value) {
- popoverArrowRef.value.style.left = `${popoverRect.width - margin / 2 + popoverArrowRef.value.offsetWidth / 2}px`;
+ const verticalOffset = popoverDirection.value === 'top' ? buttonRect.top + scrollY - props.marginY - maxHeight.value : buttonRect.bottom + props.marginY + scrollY;
+
+ const clampedTop = Math.max(verticalOffset, props.marginY + scrollY);
+
+ let left = buttonRect.left - maxWidth.value / 2 + buttonRect.width / 2 + scrollX;
+
+ const overflow = left + maxWidth.value - window.innerWidth + props.marginX + 8;
+ if (overflow > 0) {
+ left = Math.max(left - overflow, props.marginX);
+ arrowStyles.value = { left: `${maxWidth.value / 2 + overflow}px` };
+ } else {
+ arrowStyles.value = { left: `${maxWidth.value / 2 - (popoverArrow.value?.getBoundingClientRect().width ?? 10 / 2)}` };
}
+
+ popoverStyles.value = { left: `${left}px`, top: `${clampedTop}px` };
};
-const handleClickOutside = (event: PointerEvent) => {
+onClickOutside(popover, (event) => {
if (popoverButton.value?.$el?.contains(event.target as Node)) return;
popoverOpen.value = false;
-};
+});
const handleClose = () => {
+ maxWidth.value = 0;
+ maxHeight.value = 0;
popoverOpen.value = false;
};
@@ -100,29 +104,20 @@ defineExpose({ handleClose });
watch(
() => popoverOpen.value,
- async (value) => {
- if (value) {
- await nextTick();
- popoverPositionCalculate();
- adjustPopoverPosition();
- document.getElementById('width')?.focus();
- }
+ (value) => {
+ if (!value) return;
+ if (!init.value) init.value = true;
+
+ nextTick(adjustPopoverPosition);
},
);
onMounted(() => {
- window.addEventListener('resize', popoverPositionCalculate);
-
- globalThis.setTimeout(function () {
- popoverHeightCalculate();
- }, 100);
+ window.addEventListener('resize', handleClose);
});
onUnmounted(() => {
- window.removeEventListener('resize', popoverPositionCalculate);
- if (resizeTimeout.value) {
- clearTimeout(resizeTimeout.value);
- }
+ window.removeEventListener('resize', handleClose);
});
</script>
<template>
@@ -137,87 +132,50 @@ onUnmounted(() => {
</slot>
</template>
</component>
- <Transition
- enter-active-class="ease-out duration-150"
- enter-from-class="scale-[0.8] opacity-60"
- enter-to-class="scale-100 opacity-100"
- leave-active-class="ease-in-out duration-100"
- leave-from-class="scale-100 opacity-100"
- leave-to-class="scale-[0.1] opacity-50"
- >
- <UseFocusTrap
- v-if="popoverOpen"
- :class="[
- cn('ring-r-button bg-overlay-2-t absolute z-50 w-75 max-w-lg rounded-md p-4 shadow-xs ring-1 backdrop-blur-xs', popoverClass),
- '-translate-x-1/2',
- { 'left-1/2': !popoverAdjustment },
- popoverPosition === 'bottom' ? 'top-0' : 'bottom-0',
- ]"
- ref="popover"
- :options="{ allowOutsideClick: true }"
+ <Teleport :to="teleportTarget" :disabled="teleportDisabled" v-if="init">
+ <Transition
+ enter-active-class="ease-out duration-150"
+ enter-from-class="scale-[0.8] opacity-60"
+ enter-to-class="scale-100 opacity-100"
+ leave-active-class="ease-in duration-100"
+ leave-from-class="scale-100 opacity-100"
+ leave-to-class="scale-[0.1] opacity-50"
>
- <OnClickOutside @trigger="handleClickOutside" @keydown.esc="popoverOpen = false" tabindex="-1" v-show="popoverOpen" v-cloak :class="`w-full`">
+ <UseFocusTrap
+ v-if="popoverOpen"
+ ref="popover"
+ :options="{ allowOutsideClick: true, preventScroll: true }"
+ :style="popoverStyles"
+ :class="
+ cn(
+ 'absolute z-50 w-75 max-w-lg p-3',
+ 'ring-1ring-r-button bg-overlay-2-t',
+ 'rounded-md shadow backdrop-blur-xs',
+ 'transition-[scale,opacity]',
+ popoverClass,
+ )
+ "
+ @keydown.esc="popoverOpen = false"
+ >
<div
- v-show="showPopoverArrow && popoverPosition == 'bottom'"
+ v-show="showPopoverArrow"
ref="popoverArrowRef"
+ :style="arrowStyles"
:class="[
'absolute left-1/2 inline-block w-5 -translate-x-2 overflow-hidden',
- popoverPosition === 'bottom' ? 'top-0 -translate-y-2.5' : 'bottom-0 mb-px translate-y-2.5',
+ popoverDirection === 'bottom' ? 'top-0 -translate-y-2.5' : 'bottom-0 mb-px translate-y-2.5',
]"
>
<div
:class="[
'border-r-button bg-overlay-2 size-2.5 rounded-xs border-l',
- popoverPosition === 'bottom' ? 'origin-bottom-left rotate-45 border-t' : 'origin-top-left -rotate-45 border-b',
+ popoverDirection === 'bottom' ? 'origin-bottom-left rotate-45 border-t' : 'origin-top-left -rotate-45 border-b',
]"
></div>
</div>
- <slot name="content">
- <!-- Example -->
- <div class="grid gap-4">
- <div class="space-y-2">
- {{ popoverAdjustment }}
- <h4 class="leading-none font-medium">Dimensions</h4>
- <p class="text-muted-foreground text-sm">Set the dimensions for the layer.</p>
- </div>
- <div class="grid gap-2">
- <div class="grid grid-cols-3 items-center gap-4">
- <label class="text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70" for="width">Width</label
- ><input
- class="border-input ring-offset-background placeholder:text-muted-foreground col-span-2 flex h-8 w-full rounded-md border bg-transparent px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50"
- id="width"
- value="100%"
- />
- </div>
- <div class="grid grid-cols-3 items-center gap-4">
- <label class="text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70" for="maxWidth">Max. width</label
- ><input
- class="border-input ring-offset-background placeholder:text-muted-foreground col-span-2 flex h-8 w-full rounded-md border bg-transparent px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50"
- id="maxWidth"
- value="300px"
- />
- </div>
- <div class="grid grid-cols-3 items-center gap-4">
- <label class="text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70" for="height">Height</label
- ><input
- class="border-input ring-offset-background placeholder:text-muted-foreground col-span-2 flex h-8 w-full rounded-md border bg-transparent px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50"
- id="height"
- value="25px"
- />
- </div>
- <div class="grid grid-cols-3 items-center gap-4">
- <label class="text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70" for="maxHeight">Max. height</label
- ><input
- class="border-input ring-offset-background placeholder:text-muted-foreground col-span-2 flex h-8 w-full rounded-md border bg-transparent px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50"
- id="maxHeight"
- value="none"
- />
- </div>
- </div>
- </div>
- </slot>
- </OnClickOutside>
- </UseFocusTrap>
- </Transition>
+ <slot name="content"> </slot>
+ </UseFocusTrap>
+ </Transition>
+ </Teleport>
</div>
</template>
diff --git a/resources/js/components/dashboard/DashboardAnalytics.vue b/resources/js/components/dashboard/DashboardAnalytics.vue
index 31cc000f..809acfd6 100644
--- a/resources/js/components/dashboard/DashboardAnalytics.vue
+++ b/resources/js/components/dashboard/DashboardAnalytics.vue
@@ -88,11 +88,11 @@ onMounted(() => {
<template #icon><ProiconsArrowSync /></template>
</ButtonText>
<BasePopover
- :button-attributes="{ title: 'Start New Task', text: 'New Task', class: 'h-full xs:flex-initial flex-1' }"
- :button-component="ButtonText"
- popoverClass="w-52! rounded-lg mt-10 "
- class="xs:flex-initial flex-1"
ref="taskPopover"
+ class="xs:flex-initial flex-1"
+ popoverClass="max-w-40 sm:max-w-52 rounded-lg"
+ :button-component="ButtonText"
+ :button-attributes="{ title: 'Start New Task', text: 'New Task', class: 'h-full xs:flex-initial flex-1' }"
>
<template #buttonIcon>
<ProiconsAdd />
diff --git a/resources/js/components/dashboard/DashboardTasks.vue b/resources/js/components/dashboard/DashboardTasks.vue
index 3e6cab06..b01c0fc4 100644
--- a/resources/js/components/dashboard/DashboardTasks.vue
+++ b/resources/js/components/dashboard/DashboardTasks.vue
@@ -217,11 +217,11 @@ onUnmounted(async () => {
</span>
<div class="xs:*:h-8 flex w-full flex-wrap items-center gap-2 *:h-fit">
<BasePopover
+ ref="taskPopover"
class="xs:flex-initial flex-1"
- popoverClass="w-52! rounded-lg mt-10 "
- :button-attributes="{ title: 'Start New Task', text: 'New Task', class: 'xs:flex-initial flex-1 h-full' }"
+ popoverClass="max-w-40 sm:max-w-52 rounded-lg"
:button-component="ButtonText"
- ref="taskPopover"
+ :button-attributes="{ title: 'Start New Task', text: 'New Task', class: 'xs:flex-initial flex-1 h-full' }"
>
<template #buttonIcon>
<ProiconsAdd />
diff --git a/resources/js/components/menus/DashboardTaskMenu.vue b/resources/js/components/menus/DashboardTaskMenu.vue
index d135c2f3..23ecd4f1 100644
--- a/resources/js/components/menus/DashboardTaskMenu.vue
+++ b/resources/js/components/menus/DashboardTaskMenu.vue
@@ -20,8 +20,8 @@ const handleClose = (job: 'index' | 'sync' | 'verify' | 'scan' | 'verifyFolders'
</script>
<template>
- <section class="grid gap-4">
- <h4 class="leading-none font-medium">Start Server Task</h4>
+ <section class="grid gap-2 text-xs sm:p-1 sm:text-sm">
+ <h4 class="text-sm font-medium">Start Server Task</h4>
<div class="grid gap-2 *:h-8 dark:*:bg-neutral-900">
<ButtonText title="Scan for Folder Changes" text="Index Files" @click="handleClose('index')">
diff --git a/resources/js/components/menus/LibraryCardMenu.vue b/resources/js/components/menus/LibraryCardMenu.vue
index bcc95088..edef65c3 100644
--- a/resources/js/components/menus/LibraryCardMenu.vue
+++ b/resources/js/components/menus/LibraryCardMenu.vue
@@ -41,10 +41,10 @@ const { isAdmin } = useAuth();
</script>
<template>
- <div class="space-y-4" v-if="data">
- <div class="space-y-2">
- <h4 class="leading-none font-medium">Manage Library</h4>
- <p class="text-foreground-1 text-sm">Set Library Properties.</p>
+ <div class="space-y-4 text-xs lg:p-1 lg:text-sm" v-if="data">
+ <div class="space-y-2 text-sm">
+ <p class="leading-none font-medium">Manage Library</p>
+ <p class="text-foreground-1">Set Library Properties.</p>
</div>
<div class="flex flex-col gap-2 *:h-8 dark:*:bg-neutral-900">
<div class="flex h-auto! flex-col gap-1 bg-transparent!">
@@ -52,7 +52,7 @@ const { isAdmin } = useAuth();
<InputSelect
v-if="isAdmin"
name="default-folder"
- root-class="flex-1 rounded-l-none capitalize w-full! whitespace-nowrap! col-span-2"
+ root-class="flex-1 rounded-l-none capitalize w-full! whitespace-nowrap! col-span-2 text-xs lg:text-sm"
class="h-8! py-0 ps-2! dark:bg-neutral-900!"
:placeholder="'Select Default Folder'"
:default-item="folders.findIndex((folder) => folder.id == defaultFolder?.id) ?? 0"
diff --git a/resources/js/components/menus/LibraryFolderCardMenu.vue b/resources/js/components/menus/LibraryFolderCardMenu.vue
index 2bd321f2..9236c71d 100644
--- a/resources/js/components/menus/LibraryFolderCardMenu.vue
+++ b/resources/js/components/menus/LibraryFolderCardMenu.vue
@@ -1,6 +1,7 @@
<script setup lang="ts">
import type { FolderResource } from '@/contracts/media';
+import { handleEditFolderImages } from '@/service/folder/folderActions';
import { ButtonText } from '@/components/cedar-ui/button';
import { FLAGS } from '@/config/featureFlags';
@@ -8,6 +9,7 @@ import TablerDownloadOff from '@/components/icons/TablerDownloadOff.vue';
import TablerDownload from '@/components/icons/TablerDownload.vue';
import ProiconsDelete from '~icons/proicons/delete';
+import ProiconsPhoto from '~icons/proicons/photo';
import CircumEdit from '~icons/circum/edit';
const props = withDefaults(
@@ -23,10 +25,10 @@ const props = withDefaults(
</script>
<template>
- <div class="space-y-4">
- <div class="space-y-2">
- <h4 class="leading-none font-medium">Manage Folder</h4>
- <p class="text-foreground-1 text-sm">Set Folder Properties.</p>
+ <div class="space-y-4 text-xs lg:p-1 lg:text-sm" v-if="data">
+ <div class="space-y-2 text-sm">
+ <p class="leading-none font-medium">Manage Folder</p>
+ <p class="text-foreground-1">Set Folder Properties.</p>
</div>
<div class="flex flex-col gap-2 dark:*:bg-neutral-900">
@@ -43,6 +45,19 @@ const props = withDefaults(
<template #icon> <CircumEdit class="size-4" /></template>
</ButtonText>
+ <ButtonText
+ title="Edit Images"
+ @click.stop.prevent="
+ () => {
+ if (handleClosePopover) handleClosePopover();
+ handleEditFolderImages(props.data);
+ }
+ "
+ >
+ <p class="flex-1 text-start">Edit Images</p>
+ <template #icon> <ProiconsPhoto class="size-4" /></template>
+ </ButtonText>
+
<ButtonText
v-if="libraryDownloadsEnabled && data.series"
:title="'Toggle Downloads'"
diff --git a/resources/js/components/video/VideoInfoPanel.vue b/resources/js/components/video/VideoInfoPanel.vue
index 5bb2fb35..57e894e4 100755
--- a/resources/js/components/video/VideoInfoPanel.vue
+++ b/resources/js/components/video/VideoInfoPanel.vue
@@ -237,15 +237,7 @@ onMounted(() => {
</template>
</HoverCard>
- <BasePopover
- class="sm:hidden"
- popoverClass="max-w-36 p-1 rounded-md shadow-xs"
- :vertical-offset-pixels="32"
- :buttonClass="'p-1! size-6! ml-auto mt-auto ring-inset'"
- ref="mobile-popover"
- :button-component="ButtonIcon"
- :show-popover-arrow="false"
- >
+ <BasePopover ref="mobile-popover" class="sm:hidden" popoverClass="max-w-36 p-1 rounded-md" :buttonClass="'p-1 size-6 ring-inset'" :button-component="ButtonIcon">
<template #buttonIcon>
<ProiconsMoreVertical class="size-4" />
</template>
@@ -360,14 +352,7 @@ onMounted(() => {
<span class="text-nowrap">Edit Metadata</span>
</ButtonText>
- <BasePopover
- class="hidden sm:block"
- popoverClass="max-w-40 p-1 rounded-md shadow-xs"
- :vertical-offset-pixels="38"
- :buttonClass="'ring-inset size-8 p-0'"
- ref="popover"
- :button-component="ButtonIcon"
- >
+ <BasePopover ref="popover" class="hidden sm:block" popoverClass="max-w-40 p-1 rounded-md" :buttonClass="'ring-inset size-8 p-0'" :button-component="ButtonIcon">
<template #buttonIcon>
<ProiconsMoreVertical class="size-5" />
</template>