aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/animator.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/ng/animator.js')
-rw-r--r--src/ng/animator.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/ng/animator.js b/src/ng/animator.js
index 2965717b..2b399813 100644
--- a/src/ng/animator.js
+++ b/src/ng/animator.js
@@ -395,11 +395,16 @@ var $AnimatorProvider = function() {
}
function insert(element, parent, after) {
- if (after) {
- after.after(element);
- } else {
- parent.append(element);
- }
+ var afterNode = after && after[after.length - 1];
+ var parentNode = parent && parent[0] || afterNode && afterNode.parentNode;
+ var afterNextSibling = afterNode && afterNode.nextSibling;
+ forEach(element, function(node) {
+ if (afterNextSibling) {
+ parentNode.insertBefore(node, afterNextSibling);
+ } else {
+ parentNode.appendChild(node);
+ }
+ });
}
function remove(element) {