Skip to content
Snippets Groups Projects
Commit bef9921a authored by Henrik Askjer's avatar Henrik Askjer
Browse files

center definition if focused

parent 76af9f8d
No related branches found
No related tags found
No related merge requests found
......@@ -131,7 +131,12 @@ export default {
},
mounted: function() {
if (this.$route.hash == "#"+ this.title_id) {
document.getElementById(this.title_id).focus()
let focused = document.getElementById(this.title_id)
if (focused) focused.focus()
}
else if (this.$route.hash) {
let focused =document.getElementById(this.$route.hash.replace("#",""))
if (focused) focused.scrollIntoView({block: "center"})
}
},
methods: {
......
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