mirror of
https://github.com/grocy/grocy.git
synced 2026-04-04 03:46: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)
|
||||
{
|
||||
Grocy.FrontendHelpers.ValidateForm('product-form');
|
||||
updateMoveOnOpen();
|
||||
});
|
||||
$('#default_consume_location_id').change(function(event) {
|
||||
updateMoveOnOpen();
|
||||
});
|
||||
|
||||
function updateMoveOnOpen() {
|
||||
var defaultLocation = $("#location_id :selected").val();
|
||||
var consumeLocationLocation = document.getElementById('default_consume_location_id');
|
||||
console.log('defaultLocation', defaultLocation);
|
||||
console.log('consumeLocationLocation', consumeLocationLocation);
|
||||
|
||||
var moveOnOpen = document.getElementById('move_on_open');
|
||||
if (consumeLocationLocation && defaultLocation !== consumeLocationLocation) {
|
||||
moveOnOpen.removeAttribute('checked');
|
||||
moveOnOpen.setAttribute('disabled', "");
|
||||
} else {
|
||||
moveOnOpen.removeAttribute('disabled');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#product-form input').keydown(function(event)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user