mirror of
https://github.com/moparisthebest/mail
synced 2025-02-17 15:30:18 -05:00
[WO-981] Set style.display instead of style
This commit is contained in:
parent
467d001483
commit
7f0235c9b2
@ -25,10 +25,10 @@ Download.prototype.createDownload = function(options) {
|
|||||||
supportsBlob = !!new Blob();
|
supportsBlob = !!new Blob();
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
if (typeof a.download !== "undefined" && supportsBlob) {
|
if (typeof a.download !== 'undefined' && supportsBlob) {
|
||||||
// ff 30+, chrome 27+ (android: 37+)
|
// ff 30+, chrome 27+ (android: 37+)
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.style = "display: none";
|
a.style.display = 'none';
|
||||||
a.href = window.URL.createObjectURL(new Blob([content], {
|
a.href = window.URL.createObjectURL(new Blob([content], {
|
||||||
type: contentType
|
type: contentType
|
||||||
}));
|
}));
|
||||||
@ -52,15 +52,15 @@ Download.prototype.createDownload = function(options) {
|
|||||||
var url = window.URL.createObjectURL(new Blob([content], {
|
var url = window.URL.createObjectURL(new Blob([content], {
|
||||||
type: contentType
|
type: contentType
|
||||||
}));
|
}));
|
||||||
var newTab = window.open(url, "_blank");
|
var newTab = window.open(url, '_blank');
|
||||||
if (!newTab) {
|
if (!newTab) {
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// anything else, where anything at all is better than nothing
|
// 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);
|
content = util.arrBuf2BinStr(content.buffer);
|
||||||
}
|
}
|
||||||
window.open('data:' + contentType + ';base64,' + btoa(content), "_blank");
|
window.open('data:' + contentType + ';base64,' + btoa(content), '_blank');
|
||||||
}
|
}
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user