mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-10-01 01:05:53 -04:00
18 lines
407 B
TypeScript
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();
|
|
}
|
|
}
|
|
|
|
}
|