From 56f512797ffaa11535d717f7f3a4a46afa168bab Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Thu, 11 Feb 2016 14:28:57 +0900 Subject: [PATCH] Editor: Fixed duplicate loading. --- editor/index.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/editor/index.html b/editor/index.html index 1057d880a0..2409f9021e 100644 --- a/editor/index.html +++ b/editor/index.html @@ -193,6 +193,8 @@ editor.storage.get( function ( state ) { + if ( isLoadingFromHash ) return; + if ( state !== undefined ) { editor.fromJSON( state ); @@ -324,6 +326,7 @@ // + var isLoadingFromHash = false; var hash = window.location.hash; if ( hash.substr( 1, 5 ) === 'file=' ) { @@ -336,13 +339,13 @@ loader.crossOrigin = ''; loader.load( file, function ( text ) { - var json = JSON.parse( text ); - editor.clear(); - editor.fromJSON( json ); + editor.fromJSON( JSON.parse( text ) ); } ); + isLoadingFromHash = true; + } } -- GitLab