Fix initialization logic of sidebar

This commit is contained in:
squidfunk
2016-12-28 12:24:42 +01:00
parent 84dd88af69
commit 96ae06f25c
5 changed files with 6 additions and 11 deletions

View File

@@ -37,9 +37,8 @@ export default class Position {
? document.querySelector(el)
: el
/* Initialize parent container, top offset and current height */
/* Initialize parent container and current height */
this.parent_ = this.el_.parentNode
this.offset_ = this.el_.offsetTop - this.parent_.offsetTop
this.height_ = 0
}
@@ -47,6 +46,7 @@ export default class Position {
* Initialize sidebar state
*/
setup() {
this.offset_ = this.el_.offsetTop - this.parent_.offsetTop
this.update()
}