mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 20:26:42 +00:00
* Possible fix for the chore & battery dropdown clearing issue - #1560 * Revert formatting changes - #1560 Co-authored-by: Akos Pinter <akos.pinter@mhp.com>
This commit is contained in:
@@ -140,19 +140,20 @@ $('#battery_id_text_input').on('blur', function(e)
|
|||||||
{
|
{
|
||||||
possibleOptionElement = $("#battery_id option[value=\"" + gc[2] + "\"]").first();
|
possibleOptionElement = $("#battery_id option[value=\"" + gc[2] + "\"]").first();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (possibleOptionElement.length > 0)
|
|
||||||
{
|
if (possibleOptionElement.length > 0)
|
||||||
$('#battery_id').val(possibleOptionElement.val());
|
{
|
||||||
$('#battery_id').data('combobox').refresh();
|
$('#battery_id').val(possibleOptionElement.val());
|
||||||
$('#battery_id').trigger('change');
|
$('#battery_id').data('combobox').refresh();
|
||||||
}
|
$('#battery_id').trigger('change');
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
$('#battery_id').val(null);
|
{
|
||||||
$('#battery_id_text_input').val("");
|
$('#battery_id').val(null);
|
||||||
$('#battery_id').data('combobox').refresh();
|
$('#battery_id_text_input').val("");
|
||||||
$('#battery_id').trigger('change');
|
$('#battery_id').data('combobox').refresh();
|
||||||
|
$('#battery_id').trigger('change');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -161,19 +161,19 @@ $('#chore_id_text_input').on('blur', function(e)
|
|||||||
{
|
{
|
||||||
possibleOptionElement = $("#chore_id option[value=\"" + gc[2] + "\"]").first();
|
possibleOptionElement = $("#chore_id option[value=\"" + gc[2] + "\"]").first();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (possibleOptionElement.length > 0)
|
if (possibleOptionElement.length > 0)
|
||||||
{
|
{
|
||||||
$('#chore_id').val(possibleOptionElement.val());
|
$('#chore_id').val(possibleOptionElement.val());
|
||||||
$('#chore_id').data('combobox').refresh();
|
$('#chore_id').data('combobox').refresh();
|
||||||
$('#chore_id').trigger('change');
|
$('#chore_id').trigger('change');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$('#chore_id').val(null);
|
$('#chore_id').val(null);
|
||||||
$('#chore_id_text_input').val("");
|
$('#chore_id_text_input').val("");
|
||||||
$('#chore_id').data('combobox').refresh();
|
$('#chore_id').data('combobox').refresh();
|
||||||
$('#chore_id').trigger('change');
|
$('#chore_id').trigger('change');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user