diff --git a/ui/app/components/History.vue b/ui/app/components/History.vue index 187ec73f..0a9aa013 100644 --- a/ui/app/components/History.vue +++ b/ui/app/components/History.vue @@ -98,32 +98,36 @@
+ Path: {{ getPath(config.app.download_path, item) }} +
+{{ item.description }}
+{{ item.description }}
-{{ item.description }}
-+ Path: {{ getPath(config.app.download_path, item) }} +
+ +{{ item.description }}
+ +{{ title }}
@@ -206,23 +211,47 @@ const updatePosition = () => { const triggerRect = triggerRef.value.getBoundingClientRect() const popoverRect = popover.value.getBoundingClientRect() const offset = props.offset + const viewportWidth = window.innerWidth + const viewportHeight = window.innerHeight + + let effectivePlacement = props.placement + + if ('top' === props.placement) { + const spaceAbove = triggerRect.top - offset + if (spaceAbove < popoverRect.height) { + effectivePlacement = 'bottom' + } + } else if ('bottom' === props.placement) { + const spaceBelow = viewportHeight - triggerRect.bottom - offset + if (spaceBelow < popoverRect.height) { + effectivePlacement = 'top' + } + } else if ('left' === props.placement) { + const spaceLeft = triggerRect.left - offset + if (spaceLeft < popoverRect.width) { + effectivePlacement = 'right' + } + } else if ('right' === props.placement) { + const spaceRight = viewportWidth - triggerRect.right - offset + if (spaceRight < popoverRect.width) { + effectivePlacement = 'left' + } + } let top = triggerRect.bottom + offset let left = triggerRect.left + (triggerRect.width - popoverRect.width) / 2 - if ('top' == props.placement) { + if ('top' === effectivePlacement) { top = triggerRect.top - popoverRect.height - offset - } else if ('left' == props.placement) { + } else if ('left' === effectivePlacement) { top = triggerRect.top + (triggerRect.height - popoverRect.height) / 2 left = triggerRect.left - popoverRect.width - offset - } else if ('right' == props.placement) { + } else if ('right' === effectivePlacement) { top = triggerRect.top + (triggerRect.height - popoverRect.height) / 2 left = triggerRect.right + offset } const clamp = (value: number, min: number, max: number) => Math.min(Math.max(value, min), max) - const viewportWidth = window.innerWidth - const viewportHeight = window.innerHeight const maxLeft = viewportWidth - popoverRect.width - 8 const maxTop = viewportHeight - popoverRect.height - 8 @@ -284,7 +313,7 @@ onBeforeUnmount(() => { min-width: 0; } -.popover-trigger > * { +.popover-trigger>* { max-width: 100%; min-width: 0; } diff --git a/ui/app/components/Queue.vue b/ui/app/components/Queue.vue index 4d1ba748..04d5594b 100644 --- a/ui/app/components/Queue.vue +++ b/ui/app/components/Queue.vue @@ -68,39 +68,34 @@+ Duration: {{ formatTime(item.extras.duration) }} +
++ Path: {{ getPath(config.app.download_path, item) }} +
+{{ item.description }}
+{{ item.description }}
-{{ item.description }}
-