Commit 8327d840 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt
Browse files

only reset scroll position if page changed

parent 7e1811ec
Loading
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -8,8 +8,11 @@ Vue.use(Router)
const router = new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  scrollBehavior () {
    return { x: 0, y: 0 }
  scrollBehavior (to, from) {
    return {
      x: 0,
      y: from.name === to.name ? document.scrollingElement.scrollTop : 0
    }
  },
  routes: [
    {