MCPcopy
hub / github.com/angular-ui/ui-router / getBlockElements

Function getBlockElements

test/angular/1.2/angular.js:1569–1586  ·  view source on GitHub ↗

* Return the DOM siblings between the first and last node in the given array. * @param {Array} array like object * @returns {DOMElement} object containing the elements

(nodes)

Source from the content-addressed store, hash-verified

1567 * @returns {DOMElement} object containing the elements
1568 */
1569function getBlockElements(nodes) {
1570 var startNode = nodes[0],
1571 endNode = nodes[nodes.length - 1];
1572 if (startNode === endNode) {
1573 return jqLite(startNode);
1574 }
1575
1576 var element = startNode;
1577 var elements = [element];
1578
1579 do {
1580 element = element.nextSibling;
1581 if (!element) break;
1582 elements.push(element);
1583 } while (element !== endNode);
1584
1585 return jqLite(elements);
1586}
1587
1588/**
1589 * @ngdoc type

Callers 1

angular.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected