mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
28 lines
836 B
Plaintext
28 lines
836 B
Plaintext
$(document).ready(function(){
|
|
window.FLATPICKR_DATE_DEFAULT = {
|
|
dateFormat: Spree.translations.flatpickr_date_format,
|
|
locale: I18n.locale
|
|
}
|
|
window.FLATPICKR_DATETIME_DEFAULT = Object.assign(
|
|
{},
|
|
window.FLATPICKR_DATE_DEFAULT,
|
|
{
|
|
enableTime: true,
|
|
time_24hr: true,
|
|
}
|
|
);
|
|
flatpickr(".datetimepicker", window.FLATPICKR_DATETIME_DEFAULT);
|
|
$('a.close').click(function(event){
|
|
event.preventDefault();
|
|
$(this).parent().slideUp(250);
|
|
});
|
|
|
|
// Spree locates hidden with prev(), which with our current version of jQuery
|
|
// does not locate the hidden field, resulting in the delete failing. This
|
|
// handler updates the hidden field, fixing the problem.
|
|
$('body').on('click', 'a.remove_fields', function() {
|
|
$(this).next("input[type=hidden]").val("1");
|
|
return false;
|
|
});
|
|
});
|