mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
31 lines
990 B
Plaintext
31 lines
990 B
Plaintext
$(document).ready(function() {
|
|
$('.datetimepicker').datetimepicker({
|
|
dateFormat: Spree.translations.date_picker,
|
|
dayNames: Spree.translations.abbr_day_names,
|
|
dayNamesMin: Spree.translations.abbr_day_names,
|
|
monthNames: Spree.translations.month_names,
|
|
prevText: Spree.translations.previous,
|
|
nextText: Spree.translations.next,
|
|
showOn: "button",
|
|
buttonImage: "<%= asset_path 'datepicker/cal.gif' %>",
|
|
buttonImageOnly: true,
|
|
stepMinute: 15
|
|
});
|
|
});
|
|
|
|
// Overriding a broken function in Spree. Bug report at
|
|
// https://github.com/spree/spree/issues/4032
|
|
show_flash_error = function(message) {
|
|
error_div = $('.flash.error');
|
|
if (error_div.length > 0) {
|
|
error_div.html(message);
|
|
error_div.show();
|
|
} else {
|
|
if ($("#content .toolbar").length > 0) {
|
|
$("#content .toolbar").before('<div class="flash error">' + message + '</div>');
|
|
} else {
|
|
$("#progress").before('<div class="flash error">' + message + '</div>');
|
|
}
|
|
}
|
|
}
|