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

18 lines
407 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-12-09 18:34:59 -05:00
@HostListener("click")
onClick() {
// HACK: This should be behind a service in the event the library changes
if (screenfull.enabled) {
screenfull.toggle();
}
}
}