fix(ui): mount ImageViewer globally so tile clicks open as overlay, not route-redirect to /gallery
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
<AppShell>
|
<AppShell>
|
||||||
<RouterView />
|
<RouterView />
|
||||||
</AppShell>
|
</AppShell>
|
||||||
|
<ImageViewer v-if="modal.isOpen" @close="modal.close()" />
|
||||||
<AppSnackbar ref="snackbar" />
|
<AppSnackbar ref="snackbar" />
|
||||||
</v-app>
|
</v-app>
|
||||||
</template>
|
</template>
|
||||||
@@ -11,7 +12,10 @@
|
|||||||
import { onMounted, ref } from 'vue'
|
import { onMounted, ref } from 'vue'
|
||||||
import AppShell from './components/AppShell.vue'
|
import AppShell from './components/AppShell.vue'
|
||||||
import AppSnackbar from './components/AppSnackbar.vue'
|
import AppSnackbar from './components/AppSnackbar.vue'
|
||||||
|
import ImageViewer from './components/modal/ImageViewer.vue'
|
||||||
|
import { useModalStore } from './stores/modal.js'
|
||||||
|
|
||||||
|
const modal = useModalStore()
|
||||||
const snackbar = ref(null)
|
const snackbar = ref(null)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -104,11 +104,13 @@
|
|||||||
import { computed, watch } from 'vue'
|
import { computed, watch } from 'vue'
|
||||||
import { useRoute, useRouter, RouterLink } from 'vue-router'
|
import { useRoute, useRouter, RouterLink } from 'vue-router'
|
||||||
import { useArtistStore } from '../stores/artist.js'
|
import { useArtistStore } from '../stores/artist.js'
|
||||||
|
import { useModalStore } from '../stores/modal.js'
|
||||||
import MasonryGrid from '../components/discovery/MasonryGrid.vue'
|
import MasonryGrid from '../components/discovery/MasonryGrid.vue'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const store = useArtistStore()
|
const store = useArtistStore()
|
||||||
|
const modal = useModalStore()
|
||||||
|
|
||||||
const slug = computed(() => route.params.slug)
|
const slug = computed(() => route.params.slug)
|
||||||
|
|
||||||
@@ -136,7 +138,7 @@ const sparkPoints = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function openImage(id) {
|
function openImage(id) {
|
||||||
router.push({ name: 'gallery', query: { image: id } })
|
modal.open(id)
|
||||||
}
|
}
|
||||||
function openTag(tagId) {
|
function openTag(tagId) {
|
||||||
router.push({ name: 'gallery', query: { tag_id: tagId } })
|
router.push({ name: 'gallery', query: { tag_id: tagId } })
|
||||||
|
|||||||
@@ -18,10 +18,6 @@
|
|||||||
<TimelineSidebar v-if="store.images.length > 0" class="fc-gallery-layout__sidebar" />
|
<TimelineSidebar v-if="store.images.length > 0" class="fc-gallery-layout__sidebar" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ImageViewer
|
|
||||||
v-if="modal.currentImageId !== null"
|
|
||||||
@close="closeImage"
|
|
||||||
/>
|
|
||||||
<BulkEditorPanel />
|
<BulkEditorPanel />
|
||||||
</v-container>
|
</v-container>
|
||||||
</template>
|
</template>
|
||||||
@@ -35,7 +31,6 @@ import GalleryGrid from '../components/gallery/GalleryGrid.vue'
|
|||||||
import TimelineSidebar from '../components/gallery/TimelineSidebar.vue'
|
import TimelineSidebar from '../components/gallery/TimelineSidebar.vue'
|
||||||
import EmptyState from '../components/gallery/EmptyState.vue'
|
import EmptyState from '../components/gallery/EmptyState.vue'
|
||||||
import PostInfoHeader from '../components/gallery/PostInfoHeader.vue'
|
import PostInfoHeader from '../components/gallery/PostInfoHeader.vue'
|
||||||
import ImageViewer from '../components/modal/ImageViewer.vue'
|
|
||||||
import BulkEditorPanel from '../components/gallery/BulkEditorPanel.vue'
|
import BulkEditorPanel from '../components/gallery/BulkEditorPanel.vue'
|
||||||
import { useGallerySelectionStore } from '../stores/gallerySelection.js'
|
import { useGallerySelectionStore } from '../stores/gallerySelection.js'
|
||||||
|
|
||||||
|
|||||||
@@ -26,16 +26,16 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted } from 'vue'
|
import { onMounted } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
|
||||||
import { useShowcaseStore } from '../stores/showcase.js'
|
import { useShowcaseStore } from '../stores/showcase.js'
|
||||||
|
import { useModalStore } from '../stores/modal.js'
|
||||||
import MasonryGrid from '../components/discovery/MasonryGrid.vue'
|
import MasonryGrid from '../components/discovery/MasonryGrid.vue'
|
||||||
|
|
||||||
const store = useShowcaseStore()
|
const store = useShowcaseStore()
|
||||||
const router = useRouter()
|
const modal = useModalStore()
|
||||||
|
|
||||||
onMounted(() => { if (store.images.length === 0) store.fetchPage() })
|
onMounted(() => { if (store.images.length === 0) store.fetchPage() })
|
||||||
|
|
||||||
function openImage(id) {
|
function openImage(id) {
|
||||||
router.push({ name: 'gallery', query: { image: id } })
|
modal.open(id)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user