From 20123747cb072f3c98cabb5a177effc5a078f3dc Mon Sep 17 00:00:00 2001 From: Vincent Nivoliers <vincent.nivoliers@univ-lyon1.fr> Date: Fri, 23 Sep 2016 17:04:30 +0200 Subject: [PATCH] new attempt for save fix for IE --- js/pgm_construction.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/pgm_construction.js b/js/pgm_construction.js index f872bfc..ed35811 100644 --- a/js/pgm_construction.js +++ b/js/pgm_construction.js @@ -221,6 +221,11 @@ function generate_blob() { /* propose the blob for download : save all data */ 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') ; link.setAttribute('download', 'explosurf.json') ; link.href = generate_blob() ; @@ -230,7 +235,7 @@ function blob_download() { var event ; if(typeof MouseEvent !== 'function') { 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 { event = new MouseEvent('click'); } -- GitLab