diff --git a/src/app/pages/app.component.ts b/src/app/pages/app.component.ts index 0375bd6c..5c4d6f45 100644 --- a/src/app/pages/app.component.ts +++ b/src/app/pages/app.component.ts @@ -1,5 +1,5 @@ -import {Component, HostListener} from '@angular/core'; -import {I18nService, ViewService} from '@app/services'; +import {Component} from '@angular/core'; +import {I18nService} from '@app/services'; @Component({ selector: 'app-root', @@ -8,18 +8,7 @@ import {I18nService, ViewService} from '@app/services'; }) export class AppComponent { - constructor(_i18n: I18nService, - public viewSrv: ViewService - ) {} - @HostListener('window:keydown', ['$event']) - onKeyPress($event: KeyboardEvent) { - const condition = this.viewSrv.viewList.length > 1 && $event.shiftKey; - if (condition && $event.keyCode === 37) { - this.viewSrv.switchView('left'); - } - if (condition && $event.keyCode === 39) { - this.viewSrv.switchView('right'); - } + constructor(_i18n: I18nService) { } } diff --git a/src/app/services/view.ts b/src/app/services/view.ts index f95a13a0..1939e48e 100644 --- a/src/app/services/view.ts +++ b/src/app/services/view.ts @@ -40,24 +40,4 @@ export class ViewService { const index = this.viewList.indexOf(view); this.viewList.splice(index, 1); } - - switchView(direction: ('left' | 'right')) { - const viewList = this.viewList; - const viewListLength = viewList.length; - for (let i = 0; i < viewListLength; i++) { - const current: View = viewList[i]; - if (current.id === this.currentView.id) { - let nextView: View, nextViewLength: number; - const next: number = direction === 'left' ? i - 1 : i + 1; - if (direction === 'left') { - nextViewLength = next < 0 ? viewListLength - 1 : next; - } else { - nextViewLength = next >= viewListLength ? 0 : next; - } - nextView = viewList[nextViewLength]; - if (nextView) { this.activeView(nextView); } - break; - } - } - } }