Skip to content

Commit

Permalink
Fix sticky sidebar (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Aug 30, 2016
1 parent 2bc729e commit a01f9f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/components/MethodsList/methods-list.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="methods">
<div class="tag" *ngFor="let tag of tags;trackBy:trackByTagName">
<div class="tag-info" [attr.section]="tag.id" *ngIf="!tag.virtual">
<div class="tag-info" [attr.section]="tag.id" *ngIf="!tag.headless">
<h1 class="sharable-header"> <a class="share-link" href="#tag/{{tag.name | encodeURIComponent}}"></a>{{tag.name}} </h1>
<p *ngIf="tag.description" [innerHtml]="tag.description | marked"> </p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions lib/shared/components/StickySidebar/sticky-sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class StickySidebar implements OnInit, OnDestroy {

bind() {
this.cancelScrollBinding = DOM.onAndCancel(this.scrollParent, 'scroll', () => { this.updatePosition(); });
this.updatePosition();
}

unbind() {
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit a01f9f4

Please sign in to comment.