mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +00:00
Fixed single quotes problem in all pickers (fixes #264)
This commit is contained in:
@@ -43,7 +43,7 @@ $('.location-combobox').combobox({
|
||||
var prefillByName = Grocy.Components.LocationPicker.GetPicker().parent().data('prefill-by-name').toString();
|
||||
if (typeof prefillByName !== "undefined")
|
||||
{
|
||||
possibleOptionElement = $("#location_id option:contains('" + prefillByName + "')").first();
|
||||
possibleOptionElement = $("#location_id option:contains(\"" + prefillByName + "\")").first();
|
||||
|
||||
if (possibleOptionElement.length > 0)
|
||||
{
|
||||
|
@@ -70,10 +70,10 @@ if (!prefillProduct2.isEmpty())
|
||||
}
|
||||
if (typeof prefillProduct !== "undefined")
|
||||
{
|
||||
var possibleOptionElement = $("#product_id option[data-additional-searchdata*='" + prefillProduct.replace("'", "\\'") + "']").first();
|
||||
var possibleOptionElement = $("#product_id option[data-additional-searchdata*=\"" + prefillProduct + "\"]").first();
|
||||
if (possibleOptionElement.length === 0)
|
||||
{
|
||||
possibleOptionElement = $("#product_id option:contains('" + prefillProduct + "')").first();
|
||||
possibleOptionElement = $("#product_id option:contains(\"" + prefillProduct + "\")").first();
|
||||
}
|
||||
|
||||
if (possibleOptionElement.length > 0)
|
||||
@@ -120,7 +120,7 @@ $('#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.replace("'", "\\'") + "']").first();
|
||||
var possibleOptionElement = $("#product_id option[data-additional-searchdata*=\"" + input + "\"]").first();
|
||||
|
||||
if (GetUriParam('addbarcodetoselection') === undefined && possibleOptionElement.length > 0)
|
||||
{
|
||||
@@ -135,7 +135,7 @@ $('#product_id_text_input').on('blur', function(e)
|
||||
return;
|
||||
}
|
||||
|
||||
var optionElement = $("#product_id option:contains('" + input + "')").first();
|
||||
var optionElement = $("#product_id option:contains(\"" + input + "\")").first();
|
||||
if (input.length > 0 && optionElement.length === 0 && typeof GetUriParam('addbarcodetoselection') === "undefined")
|
||||
{
|
||||
var addProductWorkflowsAdditionalCssClasses = "";
|
||||
|
@@ -43,7 +43,7 @@ $('.recipe-combobox').combobox({
|
||||
var prefillByName = Grocy.Components.RecipePicker.GetPicker().parent().data('prefill-by-name').toString();
|
||||
if (typeof prefillByName !== "undefined")
|
||||
{
|
||||
possibleOptionElement = $("#recipe_id option:contains('" + prefillByName + "')").first();
|
||||
possibleOptionElement = $("#recipe_id option:contains(\"" + prefillByName + "\")").first();
|
||||
|
||||
if (possibleOptionElement.length > 0)
|
||||
{
|
||||
|
@@ -42,10 +42,10 @@ $('.user-combobox').combobox({
|
||||
var prefillUser = Grocy.Components.UserPicker.GetPicker().parent().data('prefill-by-username').toString();
|
||||
if (typeof prefillUser !== "undefined")
|
||||
{
|
||||
var possibleOptionElement = $("#user_id option[data-additional-searchdata*='" + prefillUser.replace("'", "\\'") + "']").first();
|
||||
var possibleOptionElement = $("#user_id option[data-additional-searchdata*=\"" + prefillUser + "\"]").first();
|
||||
if (possibleOptionElement.length === 0)
|
||||
{
|
||||
possibleOptionElement = $("#user_id option:contains('" + prefillUser + "')").first();
|
||||
possibleOptionElement = $("#user_id option:contains(\"" + prefillUser + "\")").first();
|
||||
}
|
||||
|
||||
if (possibleOptionElement.length > 0)
|
||||
|
Reference in New Issue
Block a user