From 9387b8e3e8adc218f458c104905b61ea921593d4 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Sat, 15 Jun 2019 14:37:29 -0700 Subject: [PATCH] Frontend: Add refresh button and automatically close search details on small devices --- frontend/src/component/p-photo-search.vue | 23 +++++++++++++++++------ frontend/src/pages/photos.vue | 16 ++++++++++------ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/frontend/src/component/p-photo-search.vue b/frontend/src/component/p-photo-search.vue index ee042abf9..0d91c1fd7 100644 --- a/frontend/src/component/p-photo-search.vue +++ b/frontend/src/component/p-photo-search.vue @@ -16,7 +16,11 @@ - + + refresh + + + {{ searchExpanded ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }} @@ -28,7 +32,7 @@ - - - - + :refresh="refresh"> @@ -28,7 +28,7 @@ staticFilter: Object }, watch: { - '$route' () { + '$route'() { const query = this.$route.query; this.filter.q = query['q']; @@ -67,14 +67,14 @@ let queryParam = this.$route.query['view']; let storedType = window.localStorage.getItem("photo_view_type"); - if(queryParam) { + if (queryParam) { window.localStorage.setItem("photo_view_type", queryParam); return queryParam; - } else if(storedType) { + } else if (storedType) { return storedType; - } else if(window.innerWidth < 960) { + } else if (window.innerWidth < 960) { return 'mosaic'; - } else if(window.innerWidth > 1600) { + } else if (window.innerWidth > 1600) { return 'details'; } @@ -153,7 +153,11 @@ }, refresh() { this.lastFilter = {}; + const pageSize = this.pageSize; + this.pageSize = this.offset + pageSize; this.search(); + this.offset = this.pageSize; + this.pageSize = pageSize; }, search() { this.scrollDisabled = true;