diff options
| author | Zephyrrus <[email protected]> | 2020-07-19 22:27:11 +0300 |
|---|---|---|
| committer | Zephyrrus <[email protected]> | 2020-07-19 22:27:11 +0300 |
| commit | c93ddb09008c45942544b13bbb03319c367f9cd8 (patch) | |
| tree | 7f6e334b8d33b42574dc19a256a944fadbaa7f66 /src/site/components/grid/Grid.vue | |
| parent | chore: add custom class to inputs until fix is released on buefy's master (diff) | |
| download | host.fuwn.me-c93ddb09008c45942544b13bbb03319c367f9cd8.tar.xz host.fuwn.me-c93ddb09008c45942544b13bbb03319c367f9cd8.zip | |
feat: Start working on a new album/tags/image info modal
Diffstat (limited to 'src/site/components/grid/Grid.vue')
| -rw-r--r-- | src/site/components/grid/Grid.vue | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/src/site/components/grid/Grid.vue b/src/site/components/grid/Grid.vue index 90c196b..1b62097 100644 --- a/src/site/components/grid/Grid.vue +++ b/src/site/components/grid/Grid.vue @@ -75,7 +75,7 @@ </a> </b-tooltip> <b-tooltip label="Albums" position="is-top"> - <a class="btn" @click="openAlbumModal(item)"> + <a class="btn" @click="handleFileModal(item)"> <i class="icon-interface-window" /> </a> </b-tooltip> @@ -121,7 +121,7 @@ <b-table-column field="purge" centered> <b-tooltip label="Albums" position="is-top"> - <a class="btn" @click="openAlbumModal(props.row)"> + <a class="btn" @click="handleFileModal(props.row)"> <i class="icon-interface-window" /> </a> </b-tooltip> @@ -153,7 +153,10 @@ </template> </b-table> </div> - <b-modal :active.sync="isAlbumsModalActive" :width="640" scroll="keep"> + <b-modal :active.sync="isAlbumsModalActive" scroll="keep"> + <ImageInfo :file="modalData.file" /> + </b-modal> + <!-- <b-modal :active.sync="isAlbumsModalActive" :width="640" scroll="keep"> <div class="card albumsModal"> <div class="card-content"> <div class="content"> @@ -176,7 +179,7 @@ </div> </div> </div> - </b-modal> + </b-modal> --> </div> </template> @@ -184,10 +187,12 @@ import { mapState } from 'vuex'; import Waterfall from './waterfall/Waterfall.vue'; +import ImageInfo from '~/components/image-modal/ImageInfo.vue'; export default { components: { Waterfall, + ImageInfo, }, props: { files: { @@ -230,6 +235,11 @@ export default { filesOffsetWaterfall: 0, filesOffsetEndWaterfall: 50, filesPerPageWaterfall: 50, + modalData: { + file: null, + tags: null, + albums: null, + }, }; }, computed: { @@ -318,6 +328,20 @@ export default { this.$store.dispatch('alert/set', { text: e.message, error: true }, { root: true }); } }, + async handleFileModal(file) { + const { id } = file; + + try { + await this.$store.dispatch('images/fetchFileMeta', id); + this.modalData.file = this.images.fileExtraInfoMap[id]; + this.modalData.albums = this.images.fileAlbumsMap[id]; + this.modalData.tags = this.images.fileTagsMap[id]; + } catch (e) { + this.$store.dispatch('alert/set', { text: e.message, error: true }, { root: true }); + } + + this.isAlbumsModalActive = true; + }, mouseOver(id) { const foundIndex = this.hoveredItems.indexOf(id); if (foundIndex > -1) return; |