mirror of
https://github.com/AMNatty/Mastodon-Circles.git
synced 2024-11-22 02:57:25 -07:00
Bugfix for Download Function
This commit is contained in:
parent
bd469cbd11
commit
8ac873d481
1 changed files with 13 additions and 4 deletions
|
@ -196,8 +196,17 @@ function httpRequest(url, callback, callbackVal=null)
|
||||||
}
|
}
|
||||||
|
|
||||||
function downloadImage(){
|
function downloadImage(){
|
||||||
var link = document.createElement('a');
|
var lnk = document.createElement('a'), e;
|
||||||
link.download = 'mastodon-circle.png';
|
lnk.download = 'mastodon-circle.png';
|
||||||
link.href = document.getElementById('canvas').toDataURL()
|
lnk.href = canvas.toDataURL("image/png;base64");
|
||||||
link.click();
|
|
||||||
|
if (document.createEvent) {
|
||||||
|
e = document.createEvent("MouseEvents");
|
||||||
|
e.initMouseEvent("click", true, true, window,
|
||||||
|
0, 0, 0, 0, 0, false, false, false,
|
||||||
|
false, 0, null);
|
||||||
|
lnk.dispatchEvent(e);
|
||||||
|
} else if (lnk.fireEvent) {
|
||||||
|
lnk.fireEvent("onclick");
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue