https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35341

--- Comment #22 from Marcel de Rooy <m.de.r...@rijksmuseum.nl> ---
Hmm. This comes from flatpickr instantiation etc. Not my favorite waste of
time:

Calendar.inc contains:
         onReady: function( selectedDates, dateStr, instance ){
             /* When flatpickr instance is created, automatically append a
"clear date" link */

This onReady is called too often.
Flatpickr says that onReady gets triggered once the calendar is in a ready
state.
What happens now, is that the edit of a circulation rule triggers this onReady
again and keeps adding buttons.

Sounds easy to fix but the automagical duplication of flatpickr inputs somehow
interferes.
In the current codebase the second input gets wrapped into the
flatpickr_wrapper class.
But if I move the onReady code to document.ready level only, somehow this
second input is no longer wrapped into that span? Although the control works,
you will see it wrap after clearing a date.

Not sure how to continue here.

Jonathan: do you have a suggestion here?

I tried several things including a filter like:

-            $(instance.input).find('~input.flatpickr:first')
+            $(instance.input)
+                .filter( function () { return $(this).siblings('span').length
== 0 } )
+                .find('~input.flatpickr:first')

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/

Reply via email to