MCPcopy Index your code
hub / github.com/SortableJS/Sortable / lastChild

Function lastChild

modular/sortable.complete.esm.js:371–377  ·  view source on GitHub ↗

* Gets the last child in the el, ignoring ghostEl or invisible elements (clones) * @param {HTMLElement} el Parent element * @param {selector} selector Any other elements that should be ignored * @return {HTMLElement} The last child, ignoring ghostEl

(el, selector)

Source from the content-addressed store, hash-verified

369 * @return {HTMLElement} The last child, ignoring ghostEl
370 */
371function lastChild(el, selector) {
372 var last = el.lastElementChild;
373 while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
374 last = last.previousElementSibling;
375 }
376 return last || null;
377}
378
379/**
380 * Returns the index of an element within its parent for a selected set of

Callers 3

_ghostIsLastFunction · 0.70

Calls 2

cssFunction · 0.70
matchesFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…