Fix scrolling to assignments
This commit is contained in:
parent
cb13aa1ea5
commit
b132e320af
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="assignment">
|
<div class="assignment" :data-scrollto="assignment.id">
|
||||||
<p class="assignment__assignment-text">
|
<p class="assignment__assignment-text">
|
||||||
{{assignment.assignment}}
|
{{assignment.assignment}}
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
if (mutation.type === 'setScrollToAssignmentReady' && mutation.payload && !this.isScrollingToAssignment) {
|
if (mutation.type === 'setScrollToAssignmentReady' && mutation.payload && !this.isScrollingToAssignment) {
|
||||||
this.scrollingToAssignment(true);
|
this.scrollingToAssignment(true);
|
||||||
let options = {
|
let options = {
|
||||||
container: '#app',
|
container: 'body',
|
||||||
easing: 'ease',
|
easing: 'ease',
|
||||||
offset: -60,
|
offset: -60,
|
||||||
onStart: (element) => {
|
onStart: (element) => {
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
y: true
|
y: true
|
||||||
};
|
};
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$scrollTo(`#${this.scrollToAssignmentId.replace(/=/g, '')}`, 1000, options);
|
this.$scrollTo(`[data-scrollto="${this.scrollToAssignmentId}"]`, 1000, options);
|
||||||
}, 250) // unfortunately this timeout is needed as it is hard to tell when everything is rendered
|
}, 250) // unfortunately this timeout is needed as it is hard to tell when everything is rendered
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue