Skip to content
Snippets Groups Projects
Commit da7b6bb1 authored by permcu's avatar permcu
Browse files

Transition from intial query to infinite scroll

parent 8d1f59d1
No related branches found
No related tags found
No related merge requests found
......@@ -69,7 +69,8 @@
:date="date"
:docs="docs"
:lastQuery="lastQuery"
:focus-on-mount="gotoDate.toMillis() === date.toMillis()"
:focus-on-mount="gotoDate && (gotoDate.toMillis() === date.toMillis())"
@init="transition"
/>
<date-select-footer :value="$route.hash.substring(1)" />
......@@ -142,10 +143,8 @@ export default {
groups: [],
courses: [],
incomplete: false,
// TODO: Start with false until main query finished
ready: false,
gotoDate: false,
// TODO: Who sets ready true & gotoDate false?
};
},
apollo: {
......@@ -220,6 +219,10 @@ export default {
this.resetDate();
// might skip query until both set = atomic
},
transition() {
this.gotoDate = false
this.ready = true
},
groupDocsByDay(docs) {
// => {dt: {date: dt, docs: doc ...} ...}
const docsByDay = docs.reduce((byDay, doc) => {
......
......@@ -49,6 +49,7 @@ export default {
default: false,
},
},
emits: ['init'],
methods: {
focus(how) {
this.$el.scrollIntoView({
......@@ -63,6 +64,7 @@ export default {
if (this.focusOnMount) {
this.$nextTick(this.focus("instant"));
console.log('focused @', this.date.toISODate());
this.$emit('init');
}
},
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment