From d534b5595b3721c1ce4db5102f1243c7e4a25ddd Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 19 Jul 2016 15:42:08 +0300 Subject: [PATCH] Workaround for problem with images in PDF on MS Edge --- public/built.js | 6 +++--- public/js/pdf.pdfmake.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/built.js b/public/built.js index 3299cc74a5..313d756a9f 100644 --- a/public/built.js +++ b/public/built.js @@ -31125,7 +31125,7 @@ function GetPdfMake(invoice, javascript, callback) { // Add ninja logo to the footer var dd = JSON.parse(javascript, jsonCallBack); var designId = invoice.invoice_design_id; - if (!invoice.features.remove_created_by) { + if (!invoice.features.remove_created_by && ! isEdge) { var footer = (typeof dd.footer === 'function') ? dd.footer() : dd.footer; if (footer) { if (footer.hasOwnProperty('columns')) { @@ -31194,14 +31194,14 @@ NINJA.decodeJavascript = function(invoice, javascript) // search/replace variables var json = { 'accountName': account.name || ' ', - 'accountLogo': window.accountLogo || blankImage, + 'accountLogo': ( ! isEdge && window.accountLogo) ? window.accountLogo : blankImage, 'accountDetails': NINJA.accountDetails(invoice), 'accountAddress': NINJA.accountAddress(invoice), 'invoiceDetails': NINJA.invoiceDetails(invoice), 'invoiceDetailsHeight': (NINJA.invoiceDetails(invoice).length * 16) + 16, 'invoiceLineItems': NINJA.invoiceLines(invoice), 'invoiceLineItemColumns': NINJA.invoiceColumns(invoice), - 'invoiceDocuments' : NINJA.invoiceDocuments(invoice), + 'invoiceDocuments' : isEdge ? [] : NINJA.invoiceDocuments(invoice), 'quantityWidth': NINJA.quantityWidth(invoice), 'taxWidth': NINJA.taxWidth(invoice), 'clientDetails': NINJA.clientDetails(invoice), diff --git a/public/js/pdf.pdfmake.js b/public/js/pdf.pdfmake.js index e0d30e0740..4da7a5d566 100644 --- a/public/js/pdf.pdfmake.js +++ b/public/js/pdf.pdfmake.js @@ -85,7 +85,7 @@ function GetPdfMake(invoice, javascript, callback) { // Add ninja logo to the footer var dd = JSON.parse(javascript, jsonCallBack); var designId = invoice.invoice_design_id; - if (!invoice.features.remove_created_by) { + if (!invoice.features.remove_created_by && ! isEdge) { var footer = (typeof dd.footer === 'function') ? dd.footer() : dd.footer; if (footer) { if (footer.hasOwnProperty('columns')) { @@ -154,14 +154,14 @@ NINJA.decodeJavascript = function(invoice, javascript) // search/replace variables var json = { 'accountName': account.name || ' ', - 'accountLogo': window.accountLogo || blankImage, + 'accountLogo': ( ! isEdge && window.accountLogo) ? window.accountLogo : blankImage, 'accountDetails': NINJA.accountDetails(invoice), 'accountAddress': NINJA.accountAddress(invoice), 'invoiceDetails': NINJA.invoiceDetails(invoice), 'invoiceDetailsHeight': (NINJA.invoiceDetails(invoice).length * 16) + 16, 'invoiceLineItems': NINJA.invoiceLines(invoice), 'invoiceLineItemColumns': NINJA.invoiceColumns(invoice), - 'invoiceDocuments' : NINJA.invoiceDocuments(invoice), + 'invoiceDocuments' : isEdge ? [] : NINJA.invoiceDocuments(invoice), 'quantityWidth': NINJA.quantityWidth(invoice), 'taxWidth': NINJA.taxWidth(invoice), 'clientDetails': NINJA.clientDetails(invoice),