Skip to content

Commit

Permalink
Fix for mime-type when DL in browser (Issue #471 and Issue #540)
Browse files Browse the repository at this point in the history
  • Loading branch information
gitbrent committed Sep 8, 2019
1 parent 2f5752e commit 694d591
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions dist/pptxgen.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/pptxgen.bundle.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/pptxgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -1861,9 +1861,9 @@ var PptxGenJS = function(){
// DESIGN: Use `createObjectURL()` (or MS-specific func for IE11) to D/L files in client browsers (FYI: synchronously executed)
if ( window.navigator.msSaveOrOpenBlob ) {
// REF: https://docs.microsoft.com/en-us/microsoft-edge/dev-guide/html5/file-api/blob
blobObject = new Blob([content]);
var blob = new Blob([content], {type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"});
jQuery(a).click(function(){
window.navigator.msSaveOrOpenBlob(blobObject, strExportName);
window.navigator.msSaveOrOpenBlob(blob, strExportName);
});
a.click();

Expand All @@ -1874,7 +1874,7 @@ var PptxGenJS = function(){
if ( gObjPptx.saveCallback ) gObjPptx.saveCallback(strExportName);
}
else if ( window.URL.createObjectURL ) {
var blob = new Blob([content], {type: "octet/stream"});
var blob = new Blob([content], {type: "application/vnd.openxmlformats-officedocument.presentationml.presentation"});
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = strExportName;
Expand Down
4 changes: 2 additions & 2 deletions dist/pptxgen.min.js

Large diffs are not rendered by default.

0 comments on commit 694d591

Please sign in to comment.