From 09e2385c67aa7b9bd7b45875636d314288c2bac8 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Tue, 31 Mar 2020 18:56:52 +0200 Subject: [PATCH] Maps: Add animation duration to settings Signed-off-by: Michael Mayer --- assets/config/settings.yml | 2 ++ frontend/src/pages/places.vue | 3 ++- frontend/src/pages/settings/general.vue | 11 +++++++++++ frontend/src/resources/options.json | 18 ++++++++++++++++++ internal/config/client.go | 2 +- internal/config/settings.go | 17 ++++++++++++++--- internal/config/settings_test.go | 13 ++++++++++--- internal/config/testdata/configEmpty.yml | 2 ++ 8 files changed, 60 insertions(+), 8 deletions(-) diff --git a/assets/config/settings.yml b/assets/config/settings.yml index 5fa9adc01..ad7842902 100755 --- a/assets/config/settings.yml +++ b/assets/config/settings.yml @@ -1,2 +1,4 @@ theme: default language: en +maps: + animate: 5000 diff --git a/frontend/src/pages/places.vue b/frontend/src/pages/places.vue index 540357c2a..89a2a526f 100644 --- a/frontend/src/pages/places.vue +++ b/frontend/src/pages/places.vue @@ -63,6 +63,7 @@ search: this.$gettext("Search"), }, config: this.$config.values, + settings: this.$config.values.settings.maps, } }, methods: { @@ -127,7 +128,7 @@ this.map.getSource("photos").setData(this.result); if (this.filter.q || !this.initialized) { - this.map.fitBounds(this.result.bbox, {maxZoom: 17, padding: 100, duration: 15000, essential: false, animate: true}); + this.map.fitBounds(this.result.bbox, {maxZoom: 17, padding: 100, duration: this.settings.animate, essential: false, animate: this.settings.animate > 0}); } this.initialized = true; diff --git a/frontend/src/pages/settings/general.vue b/frontend/src/pages/settings/general.vue index 2bcbdba2a..e4e0b1925 100644 --- a/frontend/src/pages/settings/general.vue +++ b/frontend/src/pages/settings/general.vue @@ -24,6 +24,16 @@ flat > + + + +