Skip to content

Commit

Permalink
Merge pull request #5519 from getkirby/v4/fix/5517-section-search
Browse files Browse the repository at this point in the history
Fixed section search
  • Loading branch information
distantnative authored Aug 29, 2023
2 parents 6258205 + 01ca5f1 commit 564601a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions panel/src/components/Sections/ModelsSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,17 @@ export default {
}
},
watch: {
searchterm: debounce(function () {
this.pagination.page = 0;
this.reload();
}, 200),
searchterm() {
this.search();
},
// Reload the section when
// the view has changed in the backend
timestamp() {
this.reload();
}
},
created() {
this.search = debounce(this.search, 200);
this.load();
},
methods: {
Expand Down Expand Up @@ -228,10 +228,13 @@ export default {
this.searching = !this.searching;
this.searchterm = null;
},
async reload() {
await this.load(true);
},
async search() {
this.pagination.page = 0;
await this.reload();
},
update() {
this.reload();
this.$events.emit("model.update");
Expand Down

0 comments on commit 564601a

Please sign in to comment.