matrix-dimension/web/app/shared/directives/toggle-fullscreen.directive.ts
2019-04-13 14:37:56 -06:00

20 lines
455 B
TypeScript

import { Directive, HostListener } from "@angular/core";
import * as screenfull from "screenfull";
@Directive({
selector: "[myToggleFullscreen]",
})
export class ToggleFullscreenDirective {
@HostListener("click")
onClick() {
// HACK: This should be behind a service in the event the library changes
// @ts-ignore
if (screenfull.enabled) {
// @ts-ignore
screenfull.toggle();
}
}
}