@fy-/fws-vue 2.3.24 → 2.3.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ui/DefaultGallery.vue +16 -14
- package/package.json +1 -1
|
@@ -129,36 +129,36 @@ const currentImage = computed(() => {
|
|
|
129
129
|
const imageCount = computed(() => props.images.length)
|
|
130
130
|
const currentIndex = computed(() => modelValue.value + 1)
|
|
131
131
|
|
|
132
|
-
// Simple
|
|
132
|
+
// Simple direct approach that correctly handles the info panel
|
|
133
133
|
const updateImageSizes = useDebounceFn(() => {
|
|
134
|
-
//
|
|
134
|
+
// Get the main image
|
|
135
135
|
const mainImage = document.querySelector('.image-display img') as HTMLImageElement
|
|
136
136
|
if (!mainImage) return
|
|
137
137
|
|
|
138
|
-
//
|
|
138
|
+
// Get exact measurements of all UI elements
|
|
139
139
|
const topHeight = topControlsRef.value?.offsetHeight || 0
|
|
140
140
|
|
|
141
|
-
//
|
|
142
|
-
|
|
143
|
-
const bottomPadding = windowWidth.value > 768 ? 100 : 32
|
|
144
|
-
|
|
145
|
-
// Account for info panel only on mobile (where it overlays in the middle)
|
|
146
|
-
// On desktop, we use the bottomPadding to prevent overlap
|
|
147
|
-
const infoHeight = (windowWidth.value <= 768 && infoPanel.value && infoPanelRef.value)
|
|
141
|
+
// CRITICAL: Always include the info panel height when visible
|
|
142
|
+
const infoHeight = infoPanel.value && infoPanelRef.value
|
|
148
143
|
? infoPanelRef.value.offsetHeight
|
|
149
144
|
: 0
|
|
150
145
|
|
|
151
|
-
|
|
146
|
+
// Standard padding
|
|
147
|
+
const padding = 24
|
|
148
|
+
|
|
149
|
+
// Calculate available height by subtracting ALL elements
|
|
150
|
+
const availableHeight = windowHeight.value - topHeight - infoHeight - padding
|
|
152
151
|
|
|
153
|
-
// Apply
|
|
152
|
+
// Apply the exact height constraint to the image
|
|
154
153
|
mainImage.style.maxHeight = `${availableHeight}px`
|
|
155
154
|
mainImage.style.width = 'auto'
|
|
156
155
|
|
|
157
156
|
// Handle width constraints
|
|
158
157
|
const sidebarWidth = sidePanel.value ? 256 : 0
|
|
158
|
+
const availableWidth = windowWidth.value - sidebarWidth - padding * 2
|
|
159
159
|
mainImage.style.maxWidth = windowWidth.value <= 768
|
|
160
|
-
? '
|
|
161
|
-
: `${
|
|
160
|
+
? '90vw'
|
|
161
|
+
: `${availableWidth}px`
|
|
162
162
|
}, 50)
|
|
163
163
|
|
|
164
164
|
// Modal controls
|
|
@@ -672,6 +672,8 @@ onUnmounted(() => {
|
|
|
672
672
|
v-if="infoPanel && images[modelValue]"
|
|
673
673
|
ref="infoPanelRef"
|
|
674
674
|
class="info-panel absolute bottom-0 left-0 right-0 px-4 py-3 backdrop-blur-md bg-fv-neutral-900/70 z-45"
|
|
675
|
+
@transitionend="updateImageSizes"
|
|
676
|
+
@resize="updateImageSizes"
|
|
675
677
|
>
|
|
676
678
|
<slot :value="images[modelValue]" />
|
|
677
679
|
</div>
|