mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-17 07:50:12 +01:00
baSlimScroll
This commit is contained in:
parent
be05565bdd
commit
baade22f33
7 changed files with 39 additions and 2 deletions
|
|
@ -27,6 +27,7 @@
|
||||||
"font-awesome-sass-loader": "^1.0.1",
|
"font-awesome-sass-loader": "^1.0.1",
|
||||||
"google-maps": "^3.2.1",
|
"google-maps": "^3.2.1",
|
||||||
"jquery": "^2.2.3",
|
"jquery": "^2.2.3",
|
||||||
|
"jquery-slimscroll": "^1.3.6",
|
||||||
"leaflet-map": "^0.2.1",
|
"leaflet-map": "^0.2.1",
|
||||||
"lodash": "^4.12.0",
|
"lodash": "^4.12.0",
|
||||||
"ng2-bootstrap": "^1.0.16",
|
"ng2-bootstrap": "^1.0.16",
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import {Router} from '@angular/router-deprecated';
|
||||||
|
|
||||||
import {AppState} from '../../../app.state';
|
import {AppState} from '../../../app.state';
|
||||||
import {layoutSizes} from '../../../theme';
|
import {layoutSizes} from '../../../theme';
|
||||||
|
import {BaSlimScroll} from '../../../theme/directives';
|
||||||
import {BaSidebarService} from './baSidebar.service';
|
import {BaSidebarService} from './baSidebar.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|
@ -10,7 +11,8 @@ import {BaSidebarService} from './baSidebar.service';
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
styles: [require('./baSidebar.scss')],
|
styles: [require('./baSidebar.scss')],
|
||||||
template: require('./baSidebar.html'),
|
template: require('./baSidebar.html'),
|
||||||
providers: [BaSidebarService]
|
providers: [BaSidebarService],
|
||||||
|
directives: [BaSlimScroll]
|
||||||
})
|
})
|
||||||
export class BaSidebar {
|
export class BaSidebar {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<aside class="al-sidebar" (mouseleave)="hoverElemTop=outOfArea" sidebarResize>
|
<aside class="al-sidebar" (mouseleave)="hoverElemTop=outOfArea" sidebarResize>
|
||||||
<ul class="al-sidebar-list">
|
<ul id="al-sidebar-list" class="al-sidebar-list" baSlimScroll [baSlimScrollOptions]="{height: menuHeight}">
|
||||||
<li *ngFor="let item of menuItems" class="al-sidebar-list-item"
|
<li *ngFor="let item of menuItems" class="al-sidebar-list-item"
|
||||||
[ngClass]="{'selected': item.selected && !item.expanded, 'with-sub-menu': item.subMenu, 'ba-sidebar-item-expanded': item.expanded}">
|
[ngClass]="{'selected': item.selected && !item.expanded, 'with-sub-menu': item.subMenu, 'ba-sidebar-item-expanded': item.expanded}">
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 './baScrollPosition';
|
||||||
export * from './baThemeRun';
|
export * from './baThemeRun';
|
||||||
|
export * from './baSlimScroll';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue