From: Vincent Vanwaelscappel Date: Wed, 28 Oct 2020 15:00:05 +0000 (+0100) Subject: wip #4006 @0:15 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=a42862fba28541eb8aa5217e5185131e49de1281;p=fluidbook-html5.git wip #4006 @0:15 --- diff --git a/js/libs/fluidbook/cart/fluidbook.cart.puma.js b/js/libs/fluidbook/cart/fluidbook.cart.puma.js index a1ebf1f9..3fa9cc09 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.puma.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.puma.js @@ -108,18 +108,22 @@ FluidbookCartPuma.prototype = { exportPDF: function () { var date = new Date(); - var element = document.getElementById('pumacarttable'); + var element = $('#pumacarttable').get(0); var options = { - margin: 5, + margin: 15, filename: this.fluidbook.settings.title + ' - Cart - ' + date.getFullYear() + '-' + date.getMonth() + '-' + date.getDay() + '.pdf', image: {type: 'jpeg', quality: 0.98}, html2canvas: {dpi: 150, scale: 2, letterRendering: true}, jsPDF: {unit: 'mm', format: 'A4', orientation: 'portrait'} }; - element.classList.add('print'); + $(element).addClass('print') html2pdf().set(options).from(element).save().then(function () { - source.classList.remove('print'); + $(element).removeClass('print'); }); + + setTimeout(function () { + $(element).removeClass('print'); + }, 2000); }, exportXLS: function () { @@ -140,7 +144,7 @@ FluidbookCartPuma.prototype = { currency: "EUR", minimumFractionDigits: 2, maximumFractionDigits: 2 - }) + ' ' + suffix; + }) + ' ' + suffix; }, _endMenu: function (title, content, callback) {