baSlimScroll

This commit is contained in:
nixa 2016-05-19 14:41:48 +03:00
parent be05565bdd
commit baade22f33
7 changed files with 39 additions and 2 deletions

View file

@ -0,0 +1,31 @@
import {Directive, Input, Output, ElementRef, EventEmitter} from '@angular/core';
import './baSlimScroll.loader.ts';
@Directive({
selector: '[baSlimScroll]'
})
export class BaSlimScroll {
@Input() public baSlimScrollOptions:Object;
constructor(private _elementRef:ElementRef) {
}
ngOnChanges(changes) {
this._scroll();
}
private _scroll() {
this._destroy();
this._init();
}
private _init() {
$(this._elementRef.nativeElement).slimScroll(this.baSlimScrollOptions);
}
private _destroy() {
$(this._elementRef.nativeElement).slimScroll({ destroy: true });
}
}

View file

@ -0,0 +1 @@
require('jquery-slimscroll');

View file

@ -0,0 +1 @@
export * from './baSlimScroll.directive.ts';

View file

@ -1,2 +1,3 @@
export * from './baScrollPosition';
export * from './baThemeRun';
export * from './baSlimScroll';