Максим Кудрявцев 6 년 전
부모
커밋
bad61d082c
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      editor/js/Menubar.File.js

+ 3 - 3
editor/js/Menubar.File.js

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