fix: sticky sidebar fix

This commit is contained in:
Roman Hotsiy 2017-06-14 11:12:07 +03:00
parent ae720bcf92
commit 2c836f8107
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
2 changed files with 8 additions and 2 deletions

View File

@ -6,6 +6,7 @@ branches:
- releases
matrix:
include:
- env: JOB=unit
- env: JOB=e2e-guru
fast_finish: true
allow_failures:

View File

@ -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();
}