From dcda21ba3ad0d21779cafcfa20527f4cd052f880 Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Thu, 29 Oct 2020 15:22:27 -0300 Subject: [PATCH] Fixes slideshow from not working for first slide and adds padding to metadata list inside slideshow. --- src/views/admin/js/event-bus-search.js | 2 +- src/views/theme-search/components/view-mode-slideshow.vue | 8 ++++---- src/views/theme-search/js/view-modes-mixin.js | 2 +- src/views/theme-search/pages/theme-items-page.vue | 4 ++++ src/views/theme-search/scss/_view-mode-slideshow.scss | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/views/admin/js/event-bus-search.js b/src/views/admin/js/event-bus-search.js index f325dfe24..3a40c2f03 100644 --- a/src/views/admin/js/event-bus-search.js +++ b/src/views/admin/js/event-bus-search.js @@ -135,7 +135,7 @@ export default { } // Emit slideshow-from to start this view mode from index - if (this.$route.query.view_mode != ['slideshow'] && this.$route.query['slideshow-from'] != null && this.$route.query['slideshow-from'] != undefined && this.$route.query['slideshow-from'] != false) + if (this.$route.query.view_mode != 'slideshow' && this.$route.query['slideshow-from'] !== null && this.$route.query['slideshow-from'] !== undefined && this.$route.query['slideshow-from'] !== false) this.$emit('start-slideshow-from-item', this.$route.query['slideshow-from']); // Admin View Modes diff --git a/src/views/theme-search/components/view-mode-slideshow.vue b/src/views/theme-search/components/view-mode-slideshow.vue index 326f5b943..a0950ad52 100644 --- a/src/views/theme-search/components/view-mode-slideshow.vue +++ b/src/views/theme-search/components/view-mode-slideshow.vue @@ -505,13 +505,13 @@ export default { this.hideControls = !this.hideControls; }, closeSlideViewMode() { - // Sets the perpage and paged from previous configuration - this.$eventBusSearch.setItemsPerPage(this.$parent.latestPerPageAfterViewModeWithoutPagination, true); - this.$eventBusSearch.setPage(this.$parent.latestPageAfterViewModeWithoutPagination); - let currentQuery = this.$route.query; delete currentQuery['slideshow-from']; this.$router.replace({ query: currentQuery }); + + // Sets the perpage and paged from previous configuration + this.$eventBusSearch.setItemsPerPage(this.$parent.latestPerPageAfterViewModeWithoutPagination, true); + this.$eventBusSearch.setPage(this.$parent.latestPageAfterViewModeWithoutPagination); this.$parent.onChangeViewMode(this.$parent.latestNonFullscreenViewMode ? this.$parent.latestNonFullscreenViewMode : this.$parent.defaultViewMode); }, moveToClikedSlide(index) { diff --git a/src/views/theme-search/js/view-modes-mixin.js b/src/views/theme-search/js/view-modes-mixin.js index b46235d28..3aa127243 100644 --- a/src/views/theme-search/js/view-modes-mixin.js +++ b/src/views/theme-search/js/view-modes-mixin.js @@ -54,7 +54,7 @@ export const viewModesMixin = { return metadata.value_as_html; }, starSlideshowFromHere(index) { - this.$router.replace({ query: {...this.$route.query, ...{'slideshow-from': index } }}); + this.$router.replace({ query: {...this.$route.query, ...{'slideshow-from': index } }}).catch((error) => this.$console.log(error)); } } } \ No newline at end of file diff --git a/src/views/theme-search/pages/theme-items-page.vue b/src/views/theme-search/pages/theme-items-page.vue index 667569d6b..f00d02635 100644 --- a/src/views/theme-search/pages/theme-items-page.vue +++ b/src/views/theme-search/pages/theme-items-page.vue @@ -752,6 +752,10 @@ }); this.$eventBusSearch.$on('start-slideshow-from-item', (index) => { + let currentQuery = this.$route.query; + delete currentQuery['slideshow-from']; + this.$router.replace({ query: currentQuery }).catch((error) => this.$console.log(error)); + this.latestNonFullscreenViewMode = JSON.parse(JSON.stringify(this.viewMode)); this.onChangeViewMode('slideshow'); this.initialItemPosition = index; diff --git a/src/views/theme-search/scss/_view-mode-slideshow.scss b/src/views/theme-search/scss/_view-mode-slideshow.scss index 473707981..5edcc4c5e 100644 --- a/src/views/theme-search/scss/_view-mode-slideshow.scss +++ b/src/views/theme-search/scss/_view-mode-slideshow.scss @@ -27,7 +27,7 @@ #gallery-help-button { right: 10.5rem; } -.metadata-menu { +.metadata-menu.tainacan-form { background-color: var(--tainacan-black); position: absolute; z-index: 10;