summaryrefslogtreecommitdiffstats
path: root/js/vendor/angular-animate/angular-animate.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/vendor/angular-animate/angular-animate.js')
-rw-r--r--js/vendor/angular-animate/angular-animate.js65
1 files changed, 27 insertions, 38 deletions
diff --git a/js/vendor/angular-animate/angular-animate.js b/js/vendor/angular-animate/angular-animate.js
index 2778fc564..1652a9bba 100644
--- a/js/vendor/angular-animate/angular-animate.js
+++ b/js/vendor/angular-animate/angular-animate.js
@@ -1,5 +1,5 @@
/**
- * @license AngularJS v1.5.0
+ * @license AngularJS v1.5.2
* (c) 2010-2016 Google, Inc. http://angularjs.org
* License: MIT
*/
@@ -2337,7 +2337,7 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
return matches;
}
- return {
+ var $animate = {
on: function(event, container, callback) {
var node = extractElementNode(container);
callbackRegistry[event] = callbackRegistry[event] || [];
@@ -2345,6 +2345,11 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
node: node,
callback: callback
});
+
+ // Remove the callback when the element is removed from the DOM
+ jqLite(container).on('$destroy', function() {
+ $animate.off(event, container, callback);
+ });
},
off: function(event, container, callback) {
@@ -2412,6 +2417,8 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
}
};
+ return $animate;
+
function queueAnimation(element, event, initialOptions) {
// we always make a copy of the options since
// there should never be any side effects on
@@ -2728,30 +2735,31 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
var animateChildren;
var elementDisabled = disabledElementsLookup.get(getDomNode(element));
- var parentHost = element.data(NG_ANIMATE_PIN_DATA);
+ var parentHost = jqLite.data(element[0], NG_ANIMATE_PIN_DATA);
if (parentHost) {
parentElement = parentHost;
}
- while (parentElement && parentElement.length) {
+ parentElement = getDomNode(parentElement);
+
+ while (parentElement) {
if (!rootElementDetected) {
// angular doesn't want to attempt to animate elements outside of the application
// therefore we need to ensure that the rootElement is an ancestor of the current element
rootElementDetected = isMatchingElement(parentElement, $rootElement);
}
- var parentNode = parentElement[0];
- if (parentNode.nodeType !== ELEMENT_NODE) {
+ if (parentElement.nodeType !== ELEMENT_NODE) {
// no point in inspecting the #document element
break;
}
- var details = activeAnimationsLookup.get(parentNode) || {};
+ var details = activeAnimationsLookup.get(parentElement) || {};
// either an enter, leave or move animation will commence
// therefore we can't allow any animations to take place
// but if a parent animation is class-based then that's ok
if (!parentAnimationDetected) {
- var parentElementDisabled = disabledElementsLookup.get(parentNode);
+ var parentElementDisabled = disabledElementsLookup.get(parentElement);
if (parentElementDisabled === true && elementDisabled !== false) {
// disable animations if the user hasn't explicitly enabled animations on the
@@ -2766,7 +2774,7 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
}
if (isUndefined(animateChildren) || animateChildren === true) {
- var value = parentElement.data(NG_ANIMATE_CHILDREN_DATA);
+ var value = jqLite.data(parentElement, NG_ANIMATE_CHILDREN_DATA);
if (isDefined(value)) {
animateChildren = value;
}
@@ -2789,15 +2797,15 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
if (!rootElementDetected) {
// If no rootElement is detected, check if the parentElement is pinned to another element
- parentHost = parentElement.data(NG_ANIMATE_PIN_DATA);
+ parentHost = jqLite.data(parentElement, NG_ANIMATE_PIN_DATA);
if (parentHost) {
// The pin target element becomes the next parent element
- parentElement = parentHost;
+ parentElement = getDomNode(parentHost);
continue;
}
}
- parentElement = parentElement.parent();
+ parentElement = parentElement.parentNode;
}
var allowAnimation = (!parentAnimationDetected || animateChildren) && elementDisabled !== true;
@@ -3238,11 +3246,17 @@ var $$AnimationProvider = ['$animateProvider', function($animateProvider) {
*
* ngAnimateSwap is a animation-oriented directive that allows for the container to
* be removed and entered in whenever the associated expression changes. A
- * common usecase for this directive is a rotating banner component which
+ * common usecase for this directive is a rotating banner or slider component which
* contains one image being present at a time. When the active image changes
* then the old image will perform a `leave` animation and the new element
* will be inserted via an `enter` animation.
*
+ * @animations
+ * | Animation | Occurs |
+ * |----------------------------------|--------------------------------------|
+ * | {@link ng.$animate#enter enter} | when the new element is inserted to the DOM |
+ * | {@link ng.$animate#leave leave} | when the old element is removed from the DOM |
+ *
* @example
* <example name="ngAnimateSwap-directive" module="ngAnimateSwapExample"
* deps="angular-animate.js"
@@ -4036,31 +4050,6 @@ var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $root
* possible be sure to visit the {@link ng.$animate $animate service API page}.
*
*
- * ### Preventing Collisions With Third Party Libraries
- *
- * Some third-party frameworks place animation duration defaults across many element or className
- * selectors in order to make their code small and reuseable. This can lead to issues with ngAnimate, which
- * is expecting actual animations on these elements and has to wait for their completion.
- *
- * You can prevent this unwanted behavior by using a prefix on all your animation classes:
- *
- * ```css
- * /&#42; prefixed with animate- &#42;/
- * .animate-fade-add.animate-fade-add-active {
- * transition:1s linear all;
- * opacity:0;
- * }
- * ```
- *
- * You then configure `$animate` to enforce this prefix:
- *
- * ```js
- * $animateProvider.classNameFilter(/animate-/);
- * ```
- *
- * This also may provide your application with a speed boost since only specific elements containing CSS class prefix
- * will be evaluated for animation when any DOM changes occur in the application.
- *
* ## Callbacks and Promises
*
* When `$animate` is called it returns a promise that can be used to capture when the animation has ended. Therefore if we were to trigger