add base scrolling on node opening

This commit is contained in:
axolotle
2021-06-25 18:23:19 +02:00
parent ce6026adfa
commit e2e99dc397
+7
View File
@@ -95,6 +95,13 @@ export default {
}
this.$emit('select-node', ids)
}
},
updated () {
const smarphoneStickyNav = document.querySelector('.node-view-child-list.smartphone')
const offset = smarphoneStickyNav ? smarphoneStickyNav.getBoundingClientRect().height : 0
const nodeviews = this.$el.querySelectorAll('.node-view')
document.querySelector('main').scrollTo(0, nodeviews[nodeviews.length - 1].offsetTop - offset)
}
}
</script>