]> _ Git - fluidbook-html5.git/commitdiff
wip #4006 @0:15
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 28 Oct 2020 15:00:05 +0000 (16:00 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 28 Oct 2020 15:00:05 +0000 (16:00 +0100)
js/libs/fluidbook/cart/fluidbook.cart.puma.js

index a1ebf1f9a4fff9a8a5c9729ffac3202b16c2a786..3fa9cc094c325060810e8e9d00f551baa957bf84 100644 (file)
@@ -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;
+        }) + '&nbsp;' + suffix;
     },
 
     _endMenu: function (title, content, callback) {