Fix black screen in Chrome on init.

This commit is contained in:
kovacsv 2019-05-13 06:55:22 +02:00
parent 53d0383621
commit 2dafac08c6

View File

@ -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)