Widget scrolling behavior #395

This commit is contained in:
Daniel Grams 2023-03-31 00:19:03 +02:00
parent ab8f85510d
commit e3ce95adca
2 changed files with 11 additions and 2 deletions

View File

@ -523,6 +523,8 @@ const WidgetConfigurator = {
for (var key in this.customWidget.settings) {
this.settings[key] = this.customWidget.settings[key];
}
this.initResizer();
});
},
handleLoading(isLoading) {

View File

@ -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() {