Fix on-tap for download

Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
James Ketr 2018-09-13 00:37:05 -07:00
parent ea1fb82005
commit 649e4d0964

View File

@ -149,10 +149,7 @@ Polymer({
},
download: function(event) {
event.preventDefault();
event.stopPropagation();
event.stopImmediatePropagation();
console.log("Download tapped");
var anchor = document.createElement('a');
anchor.href = this.src;
anchor.setAttribute("download", this.src.replace(/.*\/([^/]+)$/, "$1"));
@ -160,6 +157,9 @@ Polymer({
document.body.appendChild(anchor);
anchor.click();
document.body.removeChild(anchor);
event.preventDefault();
event.stopPropagation();
event.stopImmediatePropagation();
},
close: function() {