From 5db288fc3c331bdf0be35ecda0f807e608c72e99 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Fri, 21 Apr 2017 12:03:56 +0200 Subject: [PATCH] Add hint when barcode lookup is disabled --- grocy.js | 5 +++++ views/inventory.js | 2 ++ views/inventory.php | 2 +- views/purchase.js | 2 ++ views/purchase.php | 2 +- 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/grocy.js b/grocy.js index d651fa7d..f69bf312 100644 --- a/grocy.js +++ b/grocy.js @@ -95,3 +95,8 @@ Grocy.GetUriParam = function(key) } } }; + +Grocy.Wait = function(ms) +{ + return new Promise(resolve => setTimeout(resolve, ms)); +} diff --git a/views/inventory.js b/views/inventory.js index 98938620..cdc248fe 100644 --- a/views/inventory.js +++ b/views/inventory.js @@ -33,6 +33,7 @@ } toastr.success('Stock amount of ' + productDetails.product.name + ' is now ' + jsonForm.new_amount.toString() + ' ' + productDetails.quantity_unit_stock.name); + Grocy.Wait(1000); if (addBarcode !== undefined) { @@ -241,6 +242,7 @@ $(function() { $('#addbarcodetoselection').text(addBarcode); $('#flow-info-addbarcodetoselection').removeClass('hide'); + $('#barcode-lookup-disabled-hint').removeClass('hide'); } }); diff --git a/views/inventory.php b/views/inventory.php index a81c88e6..cc364522 100644 --- a/views/inventory.php +++ b/views/inventory.php @@ -4,7 +4,7 @@
- +