Fixed single quotes problem in all pickers (fixes #264)

This commit is contained in:
Bernd Bestel
2019-06-09 09:06:44 +02:00
parent a56f8be19e
commit 825be63b93
5 changed files with 9 additions and 8 deletions

View File

@@ -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)