matrix-dimension/web/app/shared/directives/toggle-fullscreen.directive.ts
2017-12-14 23:46:17 -07:00

18 lines
407 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();
}
}
}