Skip to content
Snippets Groups Projects
Commit 20123747 authored by Vincent Nivoliers's avatar Vincent Nivoliers
Browse files

new attempt for save fix for IE

parent 8d6d10db
No related branches found
No related tags found
No related merge requests found
...@@ -221,6 +221,11 @@ function generate_blob() { ...@@ -221,6 +221,11 @@ function generate_blob() {
/* propose the blob for download : save all data */ /* propose the blob for download : save all data */
function blob_download() { function blob_download() {
if(window.MSBlobBuilder) {
var bb = new MSBlobBuilder();
bb.append(JSON.stringify(localStorage));
return navigator.msSaveBlob(bb, 'explosurf.json');
}
var link = document.createElement('a') ; var link = document.createElement('a') ;
link.setAttribute('download', 'explosurf.json') ; link.setAttribute('download', 'explosurf.json') ;
link.href = generate_blob() ; link.href = generate_blob() ;
...@@ -230,7 +235,7 @@ function blob_download() { ...@@ -230,7 +235,7 @@ function blob_download() {
var event ; var event ;
if(typeof MouseEvent !== 'function') { if(typeof MouseEvent !== 'function') {
event = document.createEvent("MouseEvent"); event = document.createEvent("MouseEvent");
event.initMouseEvent("click",true,true,window,0,0,0,0,0,false,false,false,false,0,null); event.initMouseEvent("click",true,false,window,0,0,0,0,0,false,false,false,false,0,null);
} else { } else {
event = new MouseEvent('click'); event = new MouseEvent('click');
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment