瀏覽代碼

Editor: Fixed import not being able to import the same file twice. Fixes #11987

Mr.doob 8 年之前
父節點
當前提交
9b6e4baf26
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      editor/js/Menubar.File.js

+ 6 - 0
editor/js/Menubar.File.js

@@ -48,13 +48,19 @@ Menubar.File = function ( editor ) {
 
 
 	// Import
 	// Import
 
 
+	var form = document.createElement( 'form' );
+	form.style.display = 'none';
+	document.body.appendChild( form );
+
 	var fileInput = document.createElement( 'input' );
 	var fileInput = document.createElement( 'input' );
 	fileInput.type = 'file';
 	fileInput.type = 'file';
 	fileInput.addEventListener( 'change', function ( event ) {
 	fileInput.addEventListener( 'change', function ( event ) {
 
 
 		editor.loader.loadFile( fileInput.files[ 0 ] );
 		editor.loader.loadFile( fileInput.files[ 0 ] );
+		form.reset();
 
 
 	} );
 	} );
+	form.appendChild( fileInput );
 
 
 	var option = new UI.Row();
 	var option = new UI.Row();
 	option.setClass( 'option' );
 	option.setClass( 'option' );