Hotfix (will be included in v1.19.0 release): Fixed a regression bug regarding issue #56 (product-flow-popup did not work anymore)

This commit is contained in:
Bernd Bestel
2018-09-24 16:50:30 +02:00
parent ddfe33fab6
commit 067a10e1b2
5 changed files with 19 additions and 10 deletions

View File

@@ -45,7 +45,8 @@ Grocy.Components.ProductPicker.HideCustomError = function()
$('.product-combobox').combobox({
appendId: '_text_input',
bsVersion: '4'
bsVersion: '4',
clearIfNoMatch: false
});
var prefillProduct = GetUriParam('createdproduct');
@@ -81,7 +82,7 @@ if (addBarcode !== undefined)
$('#barcode-lookup-disabled-hint').removeClass('d-none');
}
$('#product_id').on('change', function(e)
$('#product_id_text_input').on('blur', function(e)
{
var input = $('#product_id_text_input').val().toString();
var possibleOptionElement = $("#product_id option[data-additional-searchdata*='" + input + "']").first();
@@ -106,14 +107,20 @@ $('#product_id').on('change', function(e)
bootbox.dialog({
message: L('"#1" could not be resolved to a product, how do you want to proceed?', input),
title: L('Create or assign product'),
onEscape: function() { },
onEscape: function()
{
Grocy.Components.ProductPicker.SetValue('');
},
size: 'large',
backdrop: true,
buttons: {
cancel: {
label: L('Cancel'),
className: 'btn-default responsive-button',
callback: function() { }
callback: function()
{
Grocy.Components.ProductPicker.SetValue('');
}
},
addnewproduct: {
label: '<strong>P</strong> ' + L('Add as new product'),