From cb71983eff2b2e4d90a4ce2070d48e13e11459db Mon Sep 17 00:00:00 2001 From: kovacsv Date: Mon, 13 May 2019 07:25:58 +0200 Subject: [PATCH] Another fix for black screen in Chrome on init. --- website/include/importerapp.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/website/include/importerapp.js b/website/include/importerapp.js index 1623dba..9331718 100644 --- a/website/include/importerapp.js +++ b/website/include/importerapp.js @@ -69,6 +69,9 @@ ImporterApp.prototype.Init = function () var match = window.matchMedia ('(max-device-width : 600px)'); this.isMobile = match.matches; + window.addEventListener ('resize', this.Resize.bind (this), false); + this.Resize (); + var canvasName = 'modelcanvas'; this.canvas = $('#' + canvasName); this.RegisterCanvasClick (); @@ -81,9 +84,6 @@ ImporterApp.prototype.Init = function () var fileInput = document.getElementById ('file'); fileInput.addEventListener ('change', this.FileSelected.bind (this), false); - window.addEventListener ('resize', this.Resize.bind (this), false); - this.Resize (); - window.onhashchange = this.LoadFilesFromHash.bind (this); var hasHashModel = this.LoadFilesFromHash (); if (!hasHashModel && !this.isMobile) { @@ -165,17 +165,12 @@ ImporterApp.prototype.Resize = function () var canvas = document.getElementById ('modelcanvas'); var height = document.body.clientHeight - top.offsetHeight; - SetHeight (canvas, 0); - SetWidth (canvas, 0); - SetHeight (left, height); - SetHeight (canvas, height); SetWidth (canvas, document.body.clientWidth - left.offsetWidth); this.introControl.Resize (); this.floatingDialog.Resize (); - this.viewer.Draw (); }; ImporterApp.prototype.JsonLoaded = function (progressBar)