aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/animate.js
diff options
context:
space:
mode:
authorBrian Ford2013-11-20 11:04:38 -0800
committerBrian Ford2013-11-20 13:58:54 -0800
commitc47abd0dd7490576f4b84ee51ebaca385c1036da (patch)
tree759e4f8906cde39b48b605ed86708da47d07eab1 /src/ng/animate.js
parent68d71bbc01d4fc1a1124039322ce5ec946f4d26f (diff)
downloadangular.js-c47abd0dd7490576f4b84ee51ebaca385c1036da.tar.bz2
fix(ngInclude): allow ngInclude to load scripts when jQuery is included
In 1.2, the behavior of ngInclude was modified to use DOM APIs rather than jqLite. This means that even when jQuery was loaded, ngInclude was not calling into it, and thus scripts were not eval'd as they had been before. Although the use of ngInclude to eval scripts as a lazy-loading strategy was never an intentional feature, this patch restores the ability to do so. Closes #3756
Diffstat (limited to 'src/ng/animate.js')
-rw-r--r--src/ng/animate.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/ng/animate.js b/src/ng/animate.js
index bb08410c..b662d9c1 100644
--- a/src/ng/animate.js
+++ b/src/ng/animate.js
@@ -99,13 +99,14 @@ var $AnimateProvider = ['$provide', function($provide) {
* inserted into the DOM
*/
enter : function(element, parent, after, done) {
- var afterNode = after && after[after.length - 1];
- var parentNode = parent && parent[0] || afterNode && afterNode.parentNode;
- // IE does not like undefined so we have to pass null.
- var afterNextSibling = (afterNode && afterNode.nextSibling) || null;
- forEach(element, function(node) {
- parentNode.insertBefore(node, afterNextSibling);
- });
+ if (after) {
+ after.after(element);
+ } else {
+ if (!parent || !parent[0]) {
+ parent = after.parent();
+ }
+ parent.append(element);
+ }
done && $timeout(done, 0, false);
},