matrix-dimension/web/app/shared/toggle-fullscreen.directive.ts

17 lines
403 B
TypeScript
Raw Normal View History

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