From 2b3f0978b70b54abea36ee131f9d3f30cb078c6c Mon Sep 17 00:00:00 2001 From: Marc Ole Bulling Date: Fri, 15 Jan 2021 14:12:04 +0100 Subject: [PATCH] Fixed that checkbox was undefined, as dialog was already closed --- public/viewjs/shoppinglist.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/viewjs/shoppinglist.js b/public/viewjs/shoppinglist.js index 17ae4aa6..6a377e3a 100644 --- a/public/viewjs/shoppinglist.js +++ b/public/viewjs/shoppinglist.js @@ -442,6 +442,7 @@ $(document).on("click", "#print-shopping-list-button", function(e) className: 'btn-secondary', callback: function () { bootbox.hideAll(); + var printHeader = $("#print-show-header").prop("checked"); var thermalPrintDialog = bootbox.dialog({ title: __t('Printing'), message: '

' + __t('Connecting to printer...') + '

' @@ -449,7 +450,7 @@ $(document).on("click", "#print-shopping-list-button", function(e) //Delaying for one second so that the alert can be closed setTimeout(function () { - Grocy.Api.Get('print/shoppinglist/thermal?list=' + $("#selected-shopping-list").val() + '&printHeader=' + $("#print-show-header").prop("checked"), + Grocy.Api.Get('print/shoppinglist/thermal?list=' + $("#selected-shopping-list").val() + '&printHeader=' + printHeader, function (result) { bootbox.hideAll();