* Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible) * and non-draggable elements * @param {HTMLElement} el The parent element * @param {Number} childNum The index of the child * @param {Object} options Parent S
(el, childNum, options, includeDragEl)
| 353 | * @return {HTMLElement} The child at index childNum, or null if not found |
| 354 | */ |
| 355 | function getChild(el, childNum, options, includeDragEl) { |
| 356 | var currentChild = 0, |
| 357 | i = 0, |
| 358 | children = el.children; |
| 359 | while (i < children.length) { |
| 360 | if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) { |
| 361 | if (currentChild === childNum) { |
| 362 | return children[i]; |
| 363 | } |
| 364 | currentChild++; |
| 365 | } |
| 366 | i++; |
| 367 | } |
| 368 | return null; |
| 369 | } |
| 370 | |
| 371 | /** |
| 372 | * Gets the last child in the el, ignoring ghostEl or invisible elements (clones) |
no test coverage detected
searching dependent graphs…