Frontend: Rename refreshList() to search() and fix formChange() in places

This commit is contained in:
Michael Mayer 2019-05-29 00:28:16 +02:00
parent 177f71612d
commit fd45769900
6 changed files with 28 additions and 28 deletions

View file

@ -491,11 +491,11 @@
this.$alert.success('Photo deleted'); this.$alert.success('Photo deleted');
}, },
formChange(event) { formChange(event) {
this.refreshList(); this.search();
}, },
clearQuery() { clearQuery() {
this.query.q = ''; this.query.q = '';
this.refreshList(); this.search();
}, },
openPhoto(index) { openPhoto(index) {
this.$viewer.show(this.results, index) this.$viewer.show(this.results, index)
@ -524,7 +524,7 @@
} }
}); });
}, },
refreshList() { search() {
this.loadMoreDisabled = true; this.loadMoreDisabled = true;
// Don't query the same data more than once:197 // Don't query the same data more than once:197
@ -562,7 +562,7 @@
created() { created() {
window.addEventListener('resize', this.handleResize); window.addEventListener('resize', this.handleResize);
this.handleResize(); this.handleResize();
this.refreshList(); this.search();
}, },
}; };
</script> </script>

View file

@ -473,11 +473,11 @@
this.$alert.success('Photo deleted'); this.$alert.success('Photo deleted');
}, },
formChange(event) { formChange(event) {
this.refreshList(); this.search();
}, },
clearQuery() { clearQuery() {
this.query.q = ''; this.query.q = '';
this.refreshList(); this.search();
}, },
openPhoto(index) { openPhoto(index) {
this.$viewer.show(this.results, index) this.$viewer.show(this.results, index)
@ -506,7 +506,7 @@
} }
}); });
}, },
refreshList() { search() {
this.loadMoreDisabled = true; this.loadMoreDisabled = true;
// Don't query the same data more than once:197 // Don't query the same data more than once:197
@ -544,7 +544,7 @@
created() { created() {
window.addEventListener('resize', this.handleResize); window.addEventListener('resize', this.handleResize);
this.handleResize(); this.handleResize();
this.refreshList(); this.search();
}, },
}; };
</script> </script>

View file

@ -399,11 +399,11 @@
this.$alert.success('Photo deleted'); this.$alert.success('Photo deleted');
}, },
formChange(event) { formChange(event) {
this.refreshList(); this.search();
}, },
clearQuery() { clearQuery() {
this.query.q = ''; this.query.q = '';
this.refreshList(); this.search();
}, },
openPhoto(index) { openPhoto(index) {
this.$viewer.show(this.results, index) this.$viewer.show(this.results, index)
@ -432,7 +432,7 @@
} }
}); });
}, },
refreshList() { search() {
this.loadMoreDisabled = true; this.loadMoreDisabled = true;
// Don't query the same data more than once:197 // Don't query the same data more than once:197
@ -473,7 +473,7 @@
created() { created() {
window.addEventListener('resize', this.handleResize); window.addEventListener('resize', this.handleResize);
this.handleResize(); this.handleResize();
this.refreshList(); this.search();
}, },
}; };
</script> </script>

View file

@ -2,7 +2,7 @@
<div class="p-page p-page-photos" v-infinite-scroll="loadMore" :infinite-scroll-disabled="scrollDisabled" <div class="p-page p-page-photos" v-infinite-scroll="loadMore" :infinite-scroll-disabled="scrollDisabled"
:infinite-scroll-distance="10" :infinite-scroll-listen-for-event="'scrollRefresh'"> :infinite-scroll-distance="10" :infinite-scroll-listen-for-event="'scrollRefresh'">
<p-photo-search :settings="settings" :filter="filter" :filter-change="refreshList" <p-photo-search :settings="settings" :filter="filter" :filter-change="search"
:settings-change="updateQuery"></p-photo-search> :settings-change="updateQuery"></p-photo-search>
<v-container fluid> <v-container fluid>
@ -104,7 +104,7 @@
this.$nextTick(() => this.$emit("scrollRefresh")); this.$nextTick(() => this.$emit("scrollRefresh"));
}, },
refreshList() { search() {
this.scrollDisabled = true; this.scrollDisabled = true;
// Don't query the same data more than once // Don't query the same data more than once
@ -140,7 +140,7 @@
next(); next();
}, },
created() { created() {
this.refreshList(); this.search();
}, },
}; };
</script> </script>

View file

@ -322,11 +322,11 @@
this.$alert.success('Photo deleted'); this.$alert.success('Photo deleted');
}, },
formChange(event) { formChange(event) {
this.refreshList(); this.search();
}, },
clearQuery() { clearQuery() {
this.query.q = ''; this.query.q = '';
this.refreshList(); this.search();
}, },
openPhoto(index) { openPhoto(index) {
this.$viewer.show(this.results, index) this.$viewer.show(this.results, index)
@ -355,7 +355,7 @@
} }
}); });
}, },
refreshList() { search() {
this.loadMoreDisabled = true; this.loadMoreDisabled = true;
// Don't query the same data more than once:197 // Don't query the same data more than once:197
@ -393,7 +393,7 @@
created() { created() {
window.addEventListener('resize', this.handleResize); window.addEventListener('resize', this.handleResize);
this.handleResize(); this.handleResize();
this.refreshList(); this.search();
}, },
}; };
</script> </script>

View file

@ -81,7 +81,7 @@
this.query.lat = position.coords.latitude; this.query.lat = position.coords.latitude;
this.query.long = position.coords.longitude; this.query.long = position.coords.longitude;
this.query.q = ""; this.query.q = "";
this.refreshList(); this.search();
}, },
currentPositionError(error) { currentPositionError(error) {
this.$alert.warning(error.message); this.$alert.warning(error.message);
@ -95,15 +95,15 @@
} }
}, },
formChange() { formChange() {
this.lat = ""; this.query.lat = "";
this.long = ""; this.query.long = "";
this.refreshList(); this.search();
}, },
clearQuery() { clearQuery() {
this.query.q = ""; this.query.q = "";
this.lat = ""; this.query.lat = "";
this.long = ""; this.query.long = "";
this.refreshList(); this.search();
}, },
resetBoundingBox() { resetBoundingBox() {
this.minLat = null; this.minLat = null;
@ -175,7 +175,7 @@
} }
}, },
refreshList() { search() {
// Don't query the same data more than once // Don't query the same data more than once
if (JSON.stringify(this.lastQuery) === JSON.stringify(this.query)) return; if (JSON.stringify(this.lastQuery) === JSON.stringify(this.query)) return;
@ -204,7 +204,7 @@
}, },
}, },
created() { created() {
this.refreshList(); this.search();
}, },
}; };
</script> </script>