Skip to content
Snippets Groups Projects
Commit b3d4344c authored by Thilo Wischmeyer's avatar Thilo Wischmeyer
Browse files

Fixed scrolling to top on submission change

Introducing the two pane layout component broke it.
parent e0de8b4d
No related branches found
No related tags found
1 merge request!284Fixed scrolling to top on submission change
Pipeline #247718 canceled
......@@ -3,7 +3,10 @@
class="pane-wrapper"
no-gutters
>
<v-col class="pane">
<v-col
ref="leftPane"
class="pane"
>
<slot name="left" />
</v-col>
<v-divider
......@@ -12,6 +15,7 @@
/>
<v-col
v-if="showRightPane"
ref="rightPane"
class="pane"
>
<slot name="right" />
......@@ -25,6 +29,14 @@ import { Vue, Component, Prop } from 'vue-property-decorator'
@Component
export default class TwoPaneLayout extends Vue {
@Prop({ type: Boolean, default: true }) showRightPane!: boolean
leftPane(): HTMLElement {
return this.$refs.leftPane as HTMLElement
}
rightPane(): HTMLElement {
return this.$refs.rightPane as HTMLElement
}
}
</script>
......
<template>
<two-pane-layout :show-right-pane="showSubmissionType">
<two-pane-layout
ref="layout"
:show-right-pane="showSubmissionType"
>
<template #left>
<v-container>
<route-change-confirmation :next-route="nextRoute" />
......@@ -58,6 +61,9 @@ const onRouteEnterOrUpdate: NavigationGuard = function (to, from, next) {
}
})
export default class SubscriptionWorkPage extends Vue {
$refs!: {
layout: TwoPaneLayout
}
subscriptionActive = false
nextRoute = () => {}
......@@ -112,7 +118,7 @@ export default class SubscriptionWorkPage extends Vue {
@Watch('currentAssignment')
onCurrentAssignmentChanged() {
window.scrollTo(0, 0)
this.$refs.layout.leftPane().scrollTop = 0
}
}
</script>
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