Fixed non-working save button on Firefox 21 (issue #49(
This commit is contained in:
parent
227f8dfcc0
commit
915497e9e0
|
@ -526,9 +526,15 @@ FileRetriever.prototype.saveFile = function (data, callback) {
|
|||
var a = document.createElement('a');
|
||||
if (this.options.html5 && a.download != undefined) {
|
||||
// save file directly using a data URL
|
||||
a.style.display = 'none';
|
||||
a.href = 'data:application/json;charset=utf-8,' + encodeURIComponent(data);
|
||||
a.download = this.getFilename();
|
||||
|
||||
// attach the element to the DOM, invoke a click action, and remove it again
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
|
||||
callbackOnce();
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue