FIX: fixed a bug with fullscreen mode

This commit is contained in:
kharhamel 2021-03-24 15:51:18 +01:00
parent 1d69af0664
commit 43921e3fcc

View File

@ -53,7 +53,7 @@ class CoWebsiteManager {
} }
get isFullScreen(): boolean { get isFullScreen(): boolean {
return this.verticalMode ? this.height === this.cowebsiteDiv.clientHeight : this.width === this.cowebsiteDiv.clientWidth return this.verticalMode ? this.height === window.innerHeight : this.width === window.innerWidth;
} }
constructor() { constructor() {
@ -199,6 +199,7 @@ class CoWebsiteManager {
private fullscreen(): void { private fullscreen(): void {
if (this.isFullScreen) { if (this.isFullScreen) {
this.resetStyle(); this.resetStyle();
this.fire();
//we don't trigger a resize of the phaser game since it won't be visible anyway. //we don't trigger a resize of the phaser game since it won't be visible anyway.
HtmlUtils.getElementByIdOrFail(cowebsiteOpenFullScreenImageId).style.display = 'inline'; HtmlUtils.getElementByIdOrFail(cowebsiteOpenFullScreenImageId).style.display = 'inline';
HtmlUtils.getElementByIdOrFail(cowebsiteCloseFullScreenImageId).style.display = 'none'; HtmlUtils.getElementByIdOrFail(cowebsiteCloseFullScreenImageId).style.display = 'none';