1
0
mirror of https://github.com/24eme/signaturepdf.git synced 2023-08-25 09:33:08 +02:00

js for btn save for sharing action

This commit is contained in:
Jb Lm 2022-03-31 18:38:38 +02:00
parent 7732ed4447
commit 8943efaf08

View File

@ -748,6 +748,18 @@ var createEventsListener = function() {
});
}
if(document.getElementById('save_share')) {
document.getElementById('save_share').addEventListener('click', function(event) {
var dataTransfer = new DataTransfer();
canvasEditions.forEach(function(canvasEdition, index) {
dataTransfer.items.add(new File([canvasEdition.toSVG()], index+'.svg', {
type: 'image/svg+xml'
}));
})
document.getElementById('input_svg_share').files = dataTransfer.files;
});
}
document.getElementById('save_mobile').addEventListener('click', function(event) {
document.getElementById('save').click();
});