From 2dafac08c66e5c8a8354e19b909ccb1e102b9513 Mon Sep 17 00:00:00 2001 From: kovacsv Date: Mon, 13 May 2019 06:55:22 +0200 Subject: [PATCH] Fix black screen in Chrome on init. --- website/include/importerapp.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/website/include/importerapp.js b/website/include/importerapp.js index 05a3940..1623dba 100644 --- a/website/include/importerapp.js +++ b/website/include/importerapp.js @@ -69,9 +69,6 @@ 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 (); @@ -84,6 +81,9 @@ 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) { @@ -175,6 +175,7 @@ ImporterApp.prototype.Resize = function () this.introControl.Resize (); this.floatingDialog.Resize (); + this.viewer.Draw (); }; ImporterApp.prototype.JsonLoaded = function (progressBar)