matrix-dimension/web/app/shared/toggle-fullscreen.directive.ts
Travis Ralston 38ac6ec4e9 Linting
2017-10-09 22:00:29 -06:00

17 lines
403 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
if (screenfull.enabled) {
screenfull.toggle();
}
}
}