+
@@ -87,7 +97,6 @@ Polymer({
listeners: {
"keydown": "onKeyDown",
- "tap": "onTap",
"blur": "onBlur",
"focus": "onFocus",
"scroll": "onScroll"
@@ -139,6 +148,20 @@ Polymer({
}
},
+ download: function(event) {
+ event.preventDefault();
+ event.stopPropagation();
+ event.stopImmediatePropagation();
+
+ var anchor = document.createElement('a');
+ anchor.href = this.src;
+ anchor.setAttribute("download", this.src.replace(/.*\/([^/]+)$/, "$1"));
+ anchor.style.display = "none";
+ document.body.appendChild(anchor);
+ anchor.click();
+ document.body.removeChild(anchor);
+ },
+
close: function() {
this.style.opacity = 0;