From af01052b1934e7512495e2703a2c22c3f8b3dd07 Mon Sep 17 00:00:00 2001 From: joric Date: Wed, 21 Aug 2024 01:15:57 +0500 Subject: [PATCH] file save dialog take 3 --- js/qle.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/qle.js b/js/qle.js index 90c82eb..312d02e 100644 --- a/js/qle.js +++ b/js/qle.js @@ -831,6 +831,14 @@ function get_char_code(id, x, y) { }); $('#download').on('click', function(e) { + var id = get_current_canvas_id(); + document.getElementById(id).toBlob(blob=>{ + showSaveFilePicker({suggestedName: id+'.png'}).then(f=>f.createWritable()).then(f=>(f.write(blob) && f.close())) + }); + }); + + + $('#download').on('click1', function(e) { var id = get_current_canvas_id(); document.getElementById(id).toBlob(blob=>{ showSaveFilePicker({suggestedName: id+'.png'}).then(f=>f.createWritable()).then(f=>(t=f).write(blob)).then(f=>t.close());