Auto "click" the shortcut checkbox when manually entering the shortcut date (references #40)

This commit is contained in:
Bernd Bestel 2018-08-09 17:25:27 +02:00
parent bb5dcb2434
commit bc7afe4bdd

View File

@ -159,6 +159,14 @@ Grocy.Components.DateTimePicker.GetInputElement().on('keyup', function(e)
element.setCustomValidity(""); element.setCustomValidity("");
} }
} }
// "Click" the shortcut checkbox when the shortcut value was
// entered manually and it is currently not set
var shortcutValue = $("#datetimepicker-shortcut").data("datetimepicker-shortcut-value");
if (value == shortcutValue && !$("#datetimepicker-shortcut").is(":checked"))
{
$("#datetimepicker-shortcut").click();
}
}); });
Grocy.Components.DateTimePicker.GetInputElement().on('input', function(e) Grocy.Components.DateTimePicker.GetInputElement().on('input', function(e)