mirror of
https://github.com/Redocly/redoc.git
synced 2025-04-05 01:14:17 +03:00
Fix sticky sidebar (#75)
This commit is contained in:
parent
2bc729ea23
commit
a01f9f41a4
|
@ -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>
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user