aboutsummaryrefslogtreecommitdiffstats
path: root/src/Angular.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/Angular.js')
-rw-r--r--src/Angular.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Angular.js b/src/Angular.js
index 478ef2a2..b09d3a7f 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -1330,23 +1330,25 @@ function getter(obj, path, bindFnToScope) {
}
/**
- * Return the siblings between `startNode` and `endNode`, inclusive
- * @param {Object} object with `startNode` and `endNode` properties
+ * Return the DOM siblings between the first and last node in the given array.
+ * @param {Array} array like object
* @returns jQlite object containing the elements
*/
-function getBlockElements(block) {
- if (block.startNode === block.endNode) {
- return jqLite(block.startNode);
+function getBlockElements(nodes) {
+ var startNode = nodes[0],
+ endNode = nodes[nodes.length - 1];
+ if (startNode === endNode) {
+ return jqLite(startNode);
}
- var element = block.startNode;
+ var element = startNode;
var elements = [element];
do {
element = element.nextSibling;
if (!element) break;
elements.push(element);
- } while (element !== block.endNode);
+ } while (element !== endNode);
return jqLite(elements);
}