From e3ce95adca6e502f61ad2e2fd4819169821ee296 Mon Sep 17 00:00:00 2001 From: Daniel Grams Date: Fri, 31 Mar 2023 00:19:03 +0200 Subject: [PATCH] Widget scrolling behavior #395 --- .../vue/widget-configurator/configurator.vue.js | 2 ++ project/static/widget/search.html | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/project/static/vue/widget-configurator/configurator.vue.js b/project/static/vue/widget-configurator/configurator.vue.js index bcbac05..b9e57c1 100644 --- a/project/static/vue/widget-configurator/configurator.vue.js +++ b/project/static/vue/widget-configurator/configurator.vue.js @@ -523,6 +523,8 @@ const WidgetConfigurator = { for (var key in this.customWidget.settings) { this.settings[key] = this.customWidget.settings[key]; } + + this.initResizer(); }); }, handleLoading(isLoading) { diff --git a/project/static/widget/search.html b/project/static/widget/search.html index cf11dd1..4e9b381 100644 --- a/project/static/widget/search.html +++ b/project/static/widget/search.html @@ -411,6 +411,7 @@ var app = new Vue({ this.isLoading = true; const params = this.getSearchParams(); + const needsScrollToTop = this.dates.length > 0; axios .get(`/api/v1/event-dates/search`, { params: params }) .then((response) => { @@ -419,14 +420,20 @@ var app = new Vue({ this.totalRows = response.data.total; this.isLoading = false; this.initialLoaded = true; - this.scrollToTop(); + + if (needsScrollToTop) { + this.scrollToTop(); + } }) .catch(error => { this.isLoading = false; this.dates = []; this.totalRows = 0; this.error = error.message; - this.scrollToTop(); + + if (needsScrollToTop) { + this.scrollToTop(); + } }); }, loadCategories() {