mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-12 12:33:07 +00:00
fixed lint errors
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { HostWindowState } from "./host-window.reducer";
|
||||
import { Injectable } from "@angular/core";
|
||||
import { Store } from "@ngrx/store";
|
||||
import { Observable } from "rxjs/Observable";
|
||||
import { hasValue } from "./empty.util";
|
||||
import { HostWindowState } from './host-window.reducer';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
//TODO ideally we should get these from sass somehow
|
||||
import { hasValue } from './empty.util';
|
||||
|
||||
// TODO: ideally we should get these from sass somehow
|
||||
export enum GridBreakpoint {
|
||||
XS = 0,
|
||||
SM = 576,
|
||||
@@ -23,36 +24,36 @@ export class HostWindowService {
|
||||
|
||||
private getWidthObs(): Observable<number> {
|
||||
return this.store.select<number>('hostWindow', 'width')
|
||||
.filter(width => hasValue(width));
|
||||
.filter((width) => hasValue(width));
|
||||
}
|
||||
|
||||
isXs(): Observable<boolean> {
|
||||
return this.getWidthObs()
|
||||
.map(width => width < GridBreakpoint.SM)
|
||||
.map((width) => width < GridBreakpoint.SM)
|
||||
.distinctUntilChanged();
|
||||
}
|
||||
|
||||
isSm(): Observable<boolean> {
|
||||
return this.getWidthObs()
|
||||
.map(width => width >= GridBreakpoint.SM && width < GridBreakpoint.MD)
|
||||
.map((width) => width >= GridBreakpoint.SM && width < GridBreakpoint.MD)
|
||||
.distinctUntilChanged();
|
||||
}
|
||||
|
||||
isMd(): Observable<boolean> {
|
||||
return this.getWidthObs()
|
||||
.map(width => width >= GridBreakpoint.MD && width < GridBreakpoint.LG)
|
||||
.map((width) => width >= GridBreakpoint.MD && width < GridBreakpoint.LG)
|
||||
.distinctUntilChanged();
|
||||
}
|
||||
|
||||
isLg(): Observable<boolean> {
|
||||
return this.getWidthObs()
|
||||
.map(width => width >= GridBreakpoint.LG && width < GridBreakpoint.XL)
|
||||
.map((width) => width >= GridBreakpoint.LG && width < GridBreakpoint.XL)
|
||||
.distinctUntilChanged();
|
||||
}
|
||||
|
||||
isXl(): Observable<boolean> {
|
||||
return this.getWidthObs()
|
||||
.map(width => width >= GridBreakpoint.XL)
|
||||
.map((width) => width >= GridBreakpoint.XL)
|
||||
.distinctUntilChanged();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user