1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-24 18:02:15 -05:00

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

This commit is contained in:
Felix Hammerl 2015-05-19 16:39:59 +02:00
parent 467d001483
commit 7f0235c9b2

View File

@ -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) {
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');
}
};