Swaps out .parents(), which only takes a string selector (not a DOM/jQuery element as is being used in the existing code) for .closest(), which can take an element too.
Since .closest() includes own element instead of just ancestors, we require a .parent() call first to "step up" 1 level in the tree before traversing.
Fixes https://github.com/Baremetrics/calendar/issues/92
Swaps out
.parents()
, which only takes a string selector (not a DOM/jQuery element as is being used in the existing code) for.closest()
, which can take an element too.Since
.closest()
includes own element instead of just ancestors, we require a.parent()
call first to "step up" 1 level in the tree before traversing.