From 1ff7f4ef82bbd6dcddacb06f9ad9f919b3f4de78 Mon Sep 17 00:00:00 2001 From: Kenneth Ellis McCall Date: Mon, 13 Feb 2017 18:55:49 -0600 Subject: [PATCH] Update pptxgen.js --- dist/pptxgen.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/pptxgen.js b/dist/pptxgen.js index 0c53a32b6..3672d59ff 100644 --- a/dist/pptxgen.js +++ b/dist/pptxgen.js @@ -114,7 +114,7 @@ var PptxGenJS = function(){ /** * Export the .pptx file (using saveAs - dep. filesaver.js) */ - function doExportPresentation() { + function doExportPresentation(callback) { var intSlideNum = 0, intRels = 0; // STEP 1: Create new JSZip file @@ -171,7 +171,7 @@ var PptxGenJS = function(){ // STEP 3: Push the PPTX file to browser var strExportName = ((gObjPptx.fileName.toLowerCase().indexOf('.ppt') > -1) ? gObjPptx.fileName : gObjPptx.fileName+gObjPptx.fileExtn); if ( NODEJS ) { - zip.generateAsync({type:'nodebuffer'}).then(function(content){ fs.writeFile(strExportName, content); }); + zip.generateAsync({type:'nodebuffer'}).then(function(content){ fs.writeFile(strExportName, content, callback); }); } else { zip.generateAsync({type:'blob'}).then(function(content){ saveAs(content, strExportName); }); @@ -1712,7 +1712,7 @@ var PptxGenJS = function(){ * Export the Presentation to an .pptx file * @param {string} [inStrExportName] - Filename to use for the export */ - this.save = function save(inStrExportName) { + this.save = function save(inStrExportName, callback) { var intRels = 0, arrRelsDone = []; // STEP 1: Set export title (if any) @@ -1731,7 +1731,7 @@ var PptxGenJS = function(){ }); // STEP 3: Export now if there's no images to encode (otherwise, last async imgConvert call above will call exportFile) - if ( intRels == 0 ) doExportPresentation(); + if ( intRels == 0 ) doExportPresentation(callback); }; /**