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 - 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:

View File

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