Browse Source

Make exporting data also work in Firefox

gero3 10 years ago
parent
commit
972b7466b1
1 changed files with 7 additions and 1 deletions
  1. 7 1
      editor/js/Menubar.File.js

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

@@ -290,7 +290,13 @@ Menubar.File = function ( editor ) {
 		link.href = objectURL;
 		link.download = filename || 'data.json';
 		link.target = '_blank';
-		link.click();
+
+		var event = document.createEvent("MouseEvents");
+		event.initMouseEvent(
+			"click", true, false, window, 0, 0, 0, 0, 0
+			, false, false, false, false, 0, null
+		);
+		link.dispatchEvent(event);
 
 	};