matrix-dimension/web/app/toggle-fullscreen/toggle-fullscreen.directive.ts
2017-10-09 21:24:12 -06:00

17 lines
401 B
TypeScript

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