https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35341
--- Comment #23 from Marcel de Rooy <[email protected]> --- As a separate function: + function add_clear_button (input) { + /* Append a "clear date" link */ + $(input).find('~input.flatpickr:first') + /* Add a wrapper element so that we can prevent the clear button from wrapping */ + .wrap("<span class='flatpickr_wrapper'></span>") + .attr("autocomplete", "off") + .after( $("<a/>") + .attr("href","#") + .addClass("clear_date") + .on("click", function(e){ + e.preventDefault(); + $(input).flatpickr().clear(); + }) + .addClass("fa fa-fw fa-times") + .attr("aria-hidden", true) + .attr("aria-label", _("Clear date") ) + ).keydown(function(e) { + var key = (event.keyCode ? event.keyCode : event.which); + if ( key == 40 ) { + $(input).flatpickr().set('allowInput',false); + } + }); + } -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
