mirror of
https://gitlab.com/openlp/web-remote.git
synced 2024-12-22 03:22:48 +00:00
Merge branch 'issue-33-missing-hotkeys' into 'master'
Fix linting issues. See merge request openlp/web-remote!52
This commit is contained in:
commit
265aafa67d
@ -71,19 +71,19 @@ export class AppComponent implements OnInit {
|
||||
);
|
||||
this.hotKeysService.addShortcut({ keys: 'Space' }).subscribe(_ =>
|
||||
{
|
||||
if (this.state.displayMode != DisplayMode.Presentation) {
|
||||
if (this.state.displayMode !== DisplayMode.Presentation) {
|
||||
this.showDisplay();
|
||||
}
|
||||
}
|
||||
);
|
||||
this.hotKeysService.addShortcut({ keys: 't' }).subscribe(_ =>
|
||||
this.state.displayMode == DisplayMode.Theme ? this.showDisplay() : this.themeDisplay()
|
||||
this.state.displayMode === DisplayMode.Theme ? this.showDisplay() : this.themeDisplay()
|
||||
);
|
||||
this.hotKeysService.addShortcut({ keys: 'code.Period' }).subscribe(_ =>
|
||||
this.state.displayMode == DisplayMode.Blank ? this.showDisplay() : this.blankDisplay()
|
||||
this.state.displayMode === DisplayMode.Blank ? this.showDisplay() : this.blankDisplay()
|
||||
);
|
||||
this.hotKeysService.addShortcut({ keys: 'd' }).subscribe(_ =>
|
||||
this.state.displayMode == DisplayMode.Desktop ? this.showDisplay() : this.desktopDisplay()
|
||||
this.state.displayMode === DisplayMode.Desktop ? this.showDisplay() : this.desktopDisplay()
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1,18 +1,18 @@
|
||||
import { DOCUMENT } from "@angular/common";
|
||||
import { Inject, Injectable } from "@angular/core";
|
||||
import { EventManager } from "@angular/platform-browser";
|
||||
import { Observable } from "rxjs";
|
||||
import { DOCUMENT } from '@angular/common';
|
||||
import { Inject, Injectable } from '@angular/core';
|
||||
import { EventManager } from '@angular/platform-browser';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
type Options = {
|
||||
interface Options {
|
||||
element: any;
|
||||
keys: string;
|
||||
}
|
||||
};
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class HotKeysService {
|
||||
defaults: Partial<Options> = {
|
||||
element: this.document
|
||||
}
|
||||
};
|
||||
|
||||
constructor(private eventManager: EventManager, @Inject(DOCUMENT) private document: Document) {
|
||||
}
|
||||
@ -25,7 +25,7 @@ export class HotKeysService {
|
||||
const handler = (e: KeyboardEvent) => {
|
||||
if (document.URL.endsWith('/slides'))
|
||||
{
|
||||
e.preventDefault()
|
||||
e.preventDefault();
|
||||
observer.next(e);
|
||||
}
|
||||
};
|
||||
@ -37,6 +37,6 @@ export class HotKeysService {
|
||||
return () => {
|
||||
dispose();
|
||||
};
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user