Fix scrolling to assignments
This commit is contained in:
parent
cb13aa1ea5
commit
b132e320af
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div class="assignment">
|
||||
<div class="assignment" :data-scrollto="assignment.id">
|
||||
<p class="assignment__assignment-text">
|
||||
{{assignment.assignment}}
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
if (mutation.type === 'setScrollToAssignmentReady' && mutation.payload && !this.isScrollingToAssignment) {
|
||||
this.scrollingToAssignment(true);
|
||||
let options = {
|
||||
container: '#app',
|
||||
container: 'body',
|
||||
easing: 'ease',
|
||||
offset: -60,
|
||||
onStart: (element) => {
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
y: true
|
||||
};
|
||||
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
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue