mirror of
https://github.com/Redocly/redoc.git
synced 2025-01-31 10:04:08 +03:00
fix: sticky sidebar fix
This commit is contained in:
parent
ae720bcf92
commit
2c836f8107
|
@ -6,6 +6,7 @@ branches:
|
|||
- releases
|
||||
matrix:
|
||||
include:
|
||||
- env: JOB=unit
|
||||
- env: JOB=e2e-guru
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
'use strict';
|
||||
|
||||
import { Directive, ElementRef, Input, OnInit, OnDestroy } from '@angular/core';
|
||||
import { Directive, ElementRef, Input, OnInit, OnDestroy, OnChanges} from '@angular/core';
|
||||
import { BrowserDomAdapter as DOM } from '../../../utils/browser-adapter';
|
||||
|
||||
@Directive({
|
||||
selector: '[sticky-sidebar]'
|
||||
})
|
||||
export class StickySidebar implements OnInit, OnDestroy {
|
||||
export class StickySidebar implements OnInit, OnDestroy, OnChanges {
|
||||
$element: any;
|
||||
cancelScrollBinding: any;
|
||||
$redocEl: any;
|
||||
|
@ -89,6 +89,11 @@ export class StickySidebar implements OnInit, OnDestroy {
|
|||
requestAnimationFrame(() => this.updatePosition());
|
||||
}
|
||||
|
||||
ngOnChanges() {
|
||||
if (this.disable) return;
|
||||
this.updatePosition();
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.unbind();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user