import { Hotkey, HotkeysService } from 'angular2-hotkeys'
import { filter, map, pairwise, switchMap } from 'rxjs/operators'
-import { DOCUMENT, PlatformLocation, ViewportScroller } from '@angular/common'
+import { DOCUMENT, getLocaleDirection, PlatformLocation, ViewportScroller } from '@angular/common'
import { AfterViewInit, Component, Inject, LOCALE_ID, OnInit, ViewChild } from '@angular/core'
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'
import { Event, GuardsCheckStart, NavigationEnd, RouteConfigLoadEnd, RouteConfigLoadStart, Router, Scroll } from '@angular/router'
this.openModalsIfNeeded()
this.document.documentElement.lang = getShortLocale(this.localeId)
+ this.document.documentElement.dir = getLocaleDirection(this.localeId)
}
ngAfterViewInit () {
// Inject JS
if (this.serverConfig.instance.customizations.javascript) {
try {
- // tslint:disable:no-eval
+ /* eslint-disable no-eval */
eval(this.serverConfig.instance.customizations.javascript)
} catch (err) {
console.error('Cannot eval custom JavaScript.', err)
private initHotkeys () {
this.hotkeysService.add([
- new Hotkey(['/', 's'], (event: KeyboardEvent): boolean => {
+ new Hotkey([ '/', 's' ], (event: KeyboardEvent): boolean => {
document.getElementById('search-video').focus()
return false
}, undefined, $localize`Focus the search bar`),