Skip to content
Snippets Groups Projects
Commit 07bc03f2 authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Implement scroll to settings submenu when it is opened

parent 51de129b
Branches
Tags
1 merge request!195Move Settings tab navigation to the main sidebar menu
Pipeline #34839 failed
......@@ -12,7 +12,7 @@
</el-menu-item>
</app-link>
</template>
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)">
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" :id="item.meta.title">
<template slot="title">
<item
v-if="item.meta"
......
......@@ -71,6 +71,15 @@ export default {
const routes = this.getMergedRoutes()
this.$store.dispatch('GenerateRoutes', { roles: this.roles, _routesWithSettings: routes })
}
let isRequesting = true
const step = () => {
document.querySelector('#settings').scrollIntoView({ block: 'start', behavior: 'smooth' })
if (isRequesting) requestAnimationFrame(step)
}
requestAnimationFrame(step)
setTimeout(() => {
isRequesting = false
}, 300) // this equals to the hide-timeout of the el-submenu
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment