浏览代码

Merge pull request #16290 from Maxsior/patch-1

Editor: Fix workaround when exporting.
Mr.doob 6 年之前
父节点
当前提交
e4a80292c7
共有 1 个文件被更改,包括 1 次插入4 次删除
  1. 1 4
      editor/js/Menubar.File.js

+ 1 - 4
editor/js/Menubar.File.js

@@ -393,14 +393,11 @@ Menubar.File = function ( editor ) {
 	//
 
 	var link = document.createElement( 'a' );
-	link.style.display = 'none';
-	document.body.appendChild( link ); // Firefox workaround, see #6594
-
 	function save( blob, filename ) {
 
 		link.href = URL.createObjectURL( blob );
 		link.download = filename || 'data.json';
-		link.click();
+		link.dispatchEvent( new MouseEvent( 'click' ) );
 
 		// URL.revokeObjectURL( url ); breaks Firefox...