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
|
- releases
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
- env: JOB=unit
|
||||||
- env: JOB=e2e-guru
|
- env: JOB=e2e-guru
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
allow_failures:
|
allow_failures:
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
'use strict';
|
'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';
|
import { BrowserDomAdapter as DOM } from '../../../utils/browser-adapter';
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[sticky-sidebar]'
|
selector: '[sticky-sidebar]'
|
||||||
})
|
})
|
||||||
export class StickySidebar implements OnInit, OnDestroy {
|
export class StickySidebar implements OnInit, OnDestroy, OnChanges {
|
||||||
$element: any;
|
$element: any;
|
||||||
cancelScrollBinding: any;
|
cancelScrollBinding: any;
|
||||||
$redocEl: any;
|
$redocEl: any;
|
||||||
|
@ -89,6 +89,11 @@ export class StickySidebar implements OnInit, OnDestroy {
|
||||||
requestAnimationFrame(() => this.updatePosition());
|
requestAnimationFrame(() => this.updatePosition());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnChanges() {
|
||||||
|
if (this.disable) return;
|
||||||
|
this.updatePosition();
|
||||||
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
this.unbind();
|
this.unbind();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user