* 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)
| 346 | * @return {HTMLElement} The last child, ignoring ghostEl |
| 347 | */ |
| 348 | function 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 | /** |
no test coverage detected
searching dependent graphs…