mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-21 15:29:30 -07:00
Click-to-fullscreen now works with Safari as well.
This commit is contained in:
@@ -41,10 +41,14 @@ export default async (canvas, config) => {
|
|||||||
canvas.height = Math.ceil(canvas.clientHeight * config.resolution);
|
canvas.height = Math.ceil(canvas.clientHeight * config.resolution);
|
||||||
};
|
};
|
||||||
window.onresize = resize;
|
window.onresize = resize;
|
||||||
if (document.fullscreenEnabled) {
|
if (document.fullscreenEnabled || document.webkitFullscreenEnabled) {
|
||||||
window.onclick = () => {
|
window.onclick = () => {
|
||||||
if (document.fullscreenElement == null) {
|
if (document.fullscreenElement == null) {
|
||||||
document.documentElement.requestFullscreen();
|
if (canvas.webkitRequestFullscreen != null) {
|
||||||
|
canvas.webkitRequestFullscreen();
|
||||||
|
} else {
|
||||||
|
canvas.requestFullscreen();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
document.exitFullscreen();
|
document.exitFullscreen();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user