mirror of
https://github.com/Redocly/redoc.git
synced 2025-01-31 10:04:08 +03:00
fix: update fix for #276 to not use className checking
This commit is contained in:
parent
f50bfb1823
commit
4dd8a0acdf
|
@ -7,7 +7,8 @@
|
||||||
<div class="background">
|
<div class="background">
|
||||||
<div class="background-actual"> </div>
|
<div class="background-actual"> </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="menu-content" sticky-sidebar [scrollParent]="options.$scrollParent" [scrollYOffset]="options.scrollYOffset">
|
<div class="menu-content" sticky-sidebar [disable]="specLoading"
|
||||||
|
[scrollParent]="options.$scrollParent" [scrollYOffset]="options.scrollYOffset">
|
||||||
<div class="menu-header">
|
<div class="menu-header">
|
||||||
<api-logo> </api-logo>
|
<api-logo> </api-logo>
|
||||||
<redoc-search> </redoc-search>
|
<redoc-search> </redoc-search>
|
||||||
|
|
|
@ -12,6 +12,7 @@ export class StickySidebar implements OnInit, OnDestroy {
|
||||||
$redocEl: any;
|
$redocEl: any;
|
||||||
@Input() scrollParent:any;
|
@Input() scrollParent:any;
|
||||||
@Input() scrollYOffset:any;
|
@Input() scrollYOffset:any;
|
||||||
|
@Input() disable:any;
|
||||||
|
|
||||||
constructor(elementRef:ElementRef) {
|
constructor(elementRef:ElementRef) {
|
||||||
this.$element = elementRef.nativeElement;
|
this.$element = elementRef.nativeElement;
|
||||||
|
@ -33,14 +34,16 @@ export class StickySidebar implements OnInit, OnDestroy {
|
||||||
|
|
||||||
updatePosition() {
|
updatePosition() {
|
||||||
var stuck = false;
|
var stuck = false;
|
||||||
if ( this.scrollY + this.scrollYOffset() >= this.$redocEl.offsetTop) {
|
if ( this.scrollY + this.scrollYOffset() >= this.$redocEl.offsetTop && !this.disable) {
|
||||||
this.stick();
|
this.stick();
|
||||||
stuck = true;
|
stuck = true;
|
||||||
} else {
|
} else {
|
||||||
this.unstick();
|
this.unstick();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( this.scrollY + window.innerHeight - this.scrollYOffset() >= this.$redocEl.scrollHeight && this.$element.parentElement.parentElement.className != 'loading') {
|
|
||||||
|
if ( this.scrollY + window.innerHeight - this.scrollYOffset()
|
||||||
|
>= this.$redocEl.scrollHeight && !this.disable) {
|
||||||
this.stickBottom();
|
this.stickBottom();
|
||||||
stuck = true;
|
stuck = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user