mirror of
https://github.com/grocy/grocy.git
synced 2026-04-10 14:36:16 +02:00
Remove console, update move on open when either the default or the consume location change
This commit is contained in:
parent
3aed834269
commit
2451e7dda8
|
|
@ -239,18 +239,24 @@ $('#product-form input').keyup(function(event)
|
||||||
$('#location_id').change(function(event)
|
$('#location_id').change(function(event)
|
||||||
{
|
{
|
||||||
Grocy.FrontendHelpers.ValidateForm('product-form');
|
Grocy.FrontendHelpers.ValidateForm('product-form');
|
||||||
|
updateMoveOnOpen();
|
||||||
});
|
});
|
||||||
$('#default_consume_location_id').change(function(event) {
|
$('#default_consume_location_id').change(function(event) {
|
||||||
|
updateMoveOnOpen();
|
||||||
|
});
|
||||||
|
|
||||||
|
function updateMoveOnOpen() {
|
||||||
var defaultLocation = $("#location_id :selected").val();
|
var defaultLocation = $("#location_id :selected").val();
|
||||||
var consumeLocationLocation = document.getElementById('default_consume_location_id');
|
var consumeLocationLocation = document.getElementById('default_consume_location_id');
|
||||||
console.log('defaultLocation', defaultLocation);
|
|
||||||
console.log('consumeLocationLocation', consumeLocationLocation);
|
|
||||||
var moveOnOpen = document.getElementById('move_on_open');
|
var moveOnOpen = document.getElementById('move_on_open');
|
||||||
if (consumeLocationLocation && defaultLocation !== consumeLocationLocation) {
|
if (consumeLocationLocation && defaultLocation !== consumeLocationLocation) {
|
||||||
|
moveOnOpen.removeAttribute('checked');
|
||||||
moveOnOpen.setAttribute('disabled', "");
|
moveOnOpen.setAttribute('disabled', "");
|
||||||
} else {
|
} else {
|
||||||
moveOnOpen.removeAttribute('disabled');
|
moveOnOpen.removeAttribute('disabled');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#product-form input').keydown(function(event)
|
$('#product-form input').keydown(function(event)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user