From a01f9f41a4303f5d18acb14e7a5b1fcdc414f61b Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Tue, 30 Aug 2016 19:35:07 +0300 Subject: [PATCH] Fix sticky sidebar (#75) --- lib/components/MethodsList/methods-list.html | 2 +- lib/shared/components/StickySidebar/sticky-sidebar.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/components/MethodsList/methods-list.html b/lib/components/MethodsList/methods-list.html index 5b63200738..11f4f859a4 100644 --- a/lib/components/MethodsList/methods-list.html +++ b/lib/components/MethodsList/methods-list.html @@ -1,6 +1,6 @@
-
+

{{tag.name}}

diff --git a/lib/shared/components/StickySidebar/sticky-sidebar.ts b/lib/shared/components/StickySidebar/sticky-sidebar.ts index 82988f4cc0..9482697ec6 100644 --- a/lib/shared/components/StickySidebar/sticky-sidebar.ts +++ b/lib/shared/components/StickySidebar/sticky-sidebar.ts @@ -25,7 +25,6 @@ export class StickySidebar implements OnInit, OnDestroy { bind() { this.cancelScrollBinding = DOM.onAndCancel(this.scrollParent, 'scroll', () => { this.updatePosition(); }); - this.updatePosition(); } unbind() { @@ -56,8 +55,9 @@ export class StickySidebar implements OnInit, OnDestroy { ngOnInit() { // FIXME use more reliable code - this.$redocEl = this.$element.offsetParent || DOM.defaultDoc().body; + this.$redocEl = this.$element.offsetParent.parentNode || DOM.defaultDoc().body; this.bind(); + this.updatePosition(); } ngOnDestroy() {