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

Function lastChild

src/utils.js:348–363  ·  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

346 * @return {HTMLElement} The last child, ignoring ghostEl
347 */
348function lastChild(el, selector) {
349 let last = el.lastElementChild;
350
351 while (
352 last &&
353 (
354 last === Sortable.ghost ||
355 css(last, 'display') === 'none' ||
356 selector && !matches(last, selector)
357 )
358 ) {
359 last = last.previousElementSibling;
360 }
361
362 return last || null;
363}
364
365
366/**

Callers 3

Sortable.jsFile · 0.90
_ghostIsLastFunction · 0.90

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…