getExportFileName: function () {
var date = new Date();
- return 'GrandVision boxes - ' + date.getFullYear() + '-' + date.getMonth() + '-' + date.getDay();
+ return 'GrandVision - ' + date.getFullYear() + '-' + date.getMonth() + '-' + date.getDay();
},
exportBoxes: function (print) {
var c = $('#grandvision-pdf');
$(c).html('');
$.each(this.boxes, function (index, box) {
- $(c).append($this.getBox(index));
+ if (index === $this.boxIndex) {
+ $(c).append($this.getBox(index));
+ }
});
var element = $(c).get(0);
var options = {
margin: 0,
- filename: this.getExportFileName() + '.pdf',
+ filename: this.getExportFileName() +'s.pdf',
image: {type: 'png'},
html2canvas: {dpi: 150, scale: 2.5, letterRendering: false},
jsPDF: {unit: 'mm', format: 'A4', orientation: 'portrait'}
$.confirm({
backgroundDismiss: true,
title: 'Warning',
- content: 'Product already used in another box: <br>'+found.join('<br>'),
+ content: 'Product already used in another box: <br>' + found.join('<br>'),
buttons: {
confirm: {
text: 'Confirm',