Browse Source

[WO-981] Set style.display instead of style

master
Felix Hammerl 8 years ago
parent
commit
7f0235c9b2
  1. 10
      src/js/util/download.js

10
src/js/util/download.js

@ -25,10 +25,10 @@ Download.prototype.createDownload = function(options) { @@ -25,10 +25,10 @@ Download.prototype.createDownload = function(options) {
supportsBlob = !!new Blob();
} catch (e) {}
if (typeof a.download !== "undefined" && supportsBlob) {
if (typeof a.download !== 'undefined' && supportsBlob) {
// ff 30+, chrome 27+ (android: 37+)
document.body.appendChild(a);
a.style = "display: none";
a.style.display = 'none';
a.href = window.URL.createObjectURL(new Blob([content], {
type: contentType
}));
@ -52,15 +52,15 @@ Download.prototype.createDownload = function(options) { @@ -52,15 +52,15 @@ Download.prototype.createDownload = function(options) {
var url = window.URL.createObjectURL(new Blob([content], {
type: contentType
}));
var newTab = window.open(url, "_blank");
var newTab = window.open(url, '_blank');
if (!newTab) {
window.location.href = url;
}
} else {
// anything else, where anything at all is better than nothing
if (typeof content !== "string" && content.buffer) {
if (typeof content !== 'string' && content.buffer) {
content = util.arrBuf2BinStr(content.buffer);
}
window.open('data:' + contentType + ';base64,' + btoa(content), "_blank");
window.open('data:' + contentType + ';base64,' + btoa(content), '_blank');
}
};
Loading…
Cancel
Save