mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-01-22 09:16:11 +01:00
baSlimScroll
This commit is contained in:
parent
be05565bdd
commit
baade22f33
7 changed files with 39 additions and 2 deletions
|
|
@ -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 });
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
require('jquery-slimscroll');
|
||||
1
src/app/theme/directives/baSlimScroll/index.ts
Normal file
1
src/app/theme/directives/baSlimScroll/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from './baSlimScroll.directive.ts';
|
||||
|
|
@ -1,2 +1,3 @@
|
|||
export * from './baScrollPosition';
|
||||
export * from './baThemeRun';
|
||||
export * from './baSlimScroll';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue