Explorar o código

new MouseEvent for each click

Максим Кудрявцев %!s(int64=6) %!d(string=hai) anos
pai
achega
3618546792
Modificáronse 1 ficheiros con 1 adicións e 4 borrados
  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...
 
 

粤ICP备19079148号