-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #205 from TAMULib/sprint10-staging
Sprint10 staging
- Loading branch information
Showing
21 changed files
with
257 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# This overrides file should contain only those value which need to be overriden | ||
# in ./defaults.env when running a build for continuous integration. | ||
# | ||
|
||
BASE_URL=https://tamulib.github.io/weaver-components/docs | ||
ASSETS_URL=https://tamulib.github.io/weaver-components/docs/assets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { MobileService } from './mobile.service'; | ||
|
||
describe('MobileService', () => { | ||
let service: MobileService; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({}); | ||
service = TestBed.inject(MobileService); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { fromEvent, Observable } from 'rxjs'; | ||
import { delay, map, throttleTime } from 'rxjs/operators'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class MobileService { | ||
|
||
isMobileLayout: boolean; | ||
|
||
private readonly screenSizeChanged$: Observable<boolean>; | ||
|
||
constructor() { | ||
this.screenSizeChanged$ = fromEvent(window, 'resize') | ||
.pipe(throttleTime(100)) | ||
.pipe(map(this.checkScreenSize)); | ||
|
||
this.screenSizeChanged$.subscribe(iml => { | ||
this.isMobileLayout = iml; | ||
}); | ||
|
||
this.isMobileLayout = this.checkScreenSize(); | ||
} | ||
|
||
private readonly checkScreenSize = () => window.innerWidth < 767; | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
projects/wvr-elements/src/lib/shared/utility/decorators.utilty.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// tslint:disable-next-line:only-arrow-functions | ||
function debounce(delay = 300): MethodDecorator { | ||
return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => { | ||
const timeoutKey = Symbol(); | ||
const original = descriptor.value; | ||
// tslint:disable-next-line:typedef | ||
descriptor.value = function(...args) { | ||
// tslint:disable-next-line:no-invalid-this | ||
clearTimeout(this[timeoutKey]); | ||
// tslint:disable-next-line:no-invalid-this | ||
this[timeoutKey] = setTimeout(() => original.apply(this, args), delay); | ||
}; | ||
|
||
return descriptor; | ||
}; | ||
} | ||
|
||
export { | ||
debounce | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export { obtainConfigPath, weaverBootstrap } from './bootstrap.utility'; | ||
|
||
export { debounce } from './decorators.utilty'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
projects/wvr-elements/src/lib/wvr-dropdown/wvr-dropdown.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
projects/wvr-elements/src/lib/wvr-footer/wvr-footer.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.