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