Browse Source

new MouseEvent for each click

Максим Кудрявцев 6 years ago
parent
commit
3618546792
1 changed files with 1 additions and 4 deletions
  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' );
 	var link = document.createElement( 'a' );
-	link.style.display = 'none'; 
-	var clickEvent = new MouseEvent('click');
-
 	function save( blob, filename ) {
 	function save( blob, filename ) {
 
 
 		link.href = URL.createObjectURL( blob );
 		link.href = URL.createObjectURL( blob );
 		link.download = filename || 'data.json';
 		link.download = filename || 'data.json';
-		link.dispatchEvent( clickEvent );
+		link.dispatchEvent( new MouseEvent('click') );
 
 
 		// URL.revokeObjectURL( url ); breaks Firefox...
 		// URL.revokeObjectURL( url ); breaks Firefox...