incremental
diff --git a/static/js/angular-animate.js b/static/js/angular-animate.js
index b18b828..121a9ef 100644
--- a/static/js/angular-animate.js
+++ b/static/js/angular-animate.js
@@ -1,6 +1,6 @@
/**
- * @license AngularJS v1.5.8
- * (c) 2010-2016 Google, Inc. http://angularjs.org
+ * @license AngularJS v1.6.4
+ * (c) 2010-2017 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, angular) {'use strict';
@@ -29,7 +29,7 @@
// Also, the only modern browser that uses vendor prefixes for transitions/keyframes is webkit
// therefore there is no reason to test anymore for other vendor prefixes:
// http://caniuse.com/#search=transition
-if ((window.ontransitionend === void 0) && (window.onwebkittransitionend !== void 0)) {
+if ((window.ontransitionend === undefined) && (window.onwebkittransitionend !== undefined)) {
CSS_PREFIX = '-webkit-';
TRANSITION_PROP = 'WebkitTransition';
TRANSITIONEND_EVENT = 'webkitTransitionEnd transitionend';
@@ -38,7 +38,7 @@
TRANSITIONEND_EVENT = 'transitionend';
}
-if ((window.onanimationend === void 0) && (window.onwebkitanimationend !== void 0)) {
+if ((window.onanimationend === undefined) && (window.onwebkitanimationend !== undefined)) {
CSS_PREFIX = '-webkit-';
ANIMATION_PROP = 'WebkitAnimation';
ANIMATIONEND_EVENT = 'webkitAnimationEnd animationend';
@@ -63,7 +63,7 @@
var ngMinErr = angular.$$minErr('ng');
function assertArg(arg, name, reason) {
if (!arg) {
- throw ngMinErr('areq', "Argument '{0}' is {1}", (name || '?'), (reason || "required"));
+ throw ngMinErr('areq', 'Argument \'{0}\' is {1}', (name || '?'), (reason || 'required'));
}
return arg;
}
@@ -139,7 +139,7 @@
if (!element[0]) return element;
for (var i = 0; i < element.length; i++) {
var elm = element[i];
- if (elm.nodeType == ELEMENT_NODE) {
+ if (elm.nodeType === ELEMENT_NODE) {
return elm;
}
}
@@ -423,7 +423,7 @@
* of the children's parents are currently animating. By default, when an element has an active `enter`, `leave`, or `move`
* (structural) animation, child elements that also have an active structural animation are not animated.
*
- * Note that even if `ngAnimteChildren` is set, no child animations will run when the parent element is removed from the DOM (`leave` animation).
+ * Note that even if `ngAnimateChildren` is set, no child animations will run when the parent element is removed from the DOM (`leave` animation).
*
*
* @param {string} ngAnimateChildren If the value is empty, `true` or `on`,
@@ -432,7 +432,7 @@
* @example
* <example module="ngAnimateChildren" name="ngAnimateChildren" deps="angular-animate.js" animations="true">
<file name="index.html">
- <div ng-controller="mainController as main">
+ <div ng-controller="MainController as main">
<label>Show container? <input type="checkbox" ng-model="main.enterElement" /></label>
<label>Animate children? <input type="checkbox" ng-model="main.animateChildren" /></label>
<hr>
@@ -482,7 +482,7 @@
</file>
<file name="script.js">
angular.module('ngAnimateChildren', ['ngAnimate'])
- .controller('mainController', function() {
+ .controller('MainController', function MainController() {
this.animateChildren = false;
this.enterElement = false;
});
@@ -510,6 +510,8 @@
};
}];
+/* exported $AnimateCssProvider */
+
var ANIMATE_TIMER_KEY = '$$animateCss';
/**
@@ -727,7 +729,6 @@
* * `end` - This method will cancel the animation and remove all applied CSS classes and styles.
*/
var ONE_SECOND = 1000;
-var BASE_TEN = 10;
var ELAPSED_TIME_MAX_DECIMAL_PLACES = 3;
var CLOSING_TIME_BUFFER = 1.5;
@@ -789,7 +790,7 @@
forEach(values, function(value) {
// it's always safe to consider only second values and omit `ms` values since
// getComputedStyle will always handle the conversion for us
- if (value.charAt(value.length - 1) == 's') {
+ if (value.charAt(value.length - 1) === 's') {
value = value.substring(0, value.length - 1);
}
value = parseFloat(value) || 0;
@@ -857,7 +858,7 @@
});
}
-var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
+var $AnimateCssProvider = ['$animateProvider', /** @this */ function($animateProvider) {
var gcsLookup = createLocalCacheLookup();
var gcsStaggerLookup = createLocalCacheLookup();
@@ -870,7 +871,7 @@
var parentCounter = 0;
function gcsHashFn(node, extraClasses) {
- var KEY = "$$ngAnimateParentKey";
+ var KEY = '$$ngAnimateParentKey';
var parentNode = node.parentNode;
var parentID = parentNode[KEY] || (parentNode[KEY] = ++parentCounter);
return parentID + '-' + node.getAttribute('class') + '-' + extraClasses;
@@ -921,7 +922,6 @@
return stagger || {};
}
- var cancelLastRAFRequest;
var rafWaitQueue = [];
function waitUntilQuiet(callback) {
rafWaitQueue.push(callback);
@@ -1110,7 +1110,7 @@
var flags = {};
flags.hasTransitions = timings.transitionDuration > 0;
flags.hasAnimations = timings.animationDuration > 0;
- flags.hasTransitionAll = flags.hasTransitions && timings.transitionProperty == 'all';
+ flags.hasTransitionAll = flags.hasTransitions && timings.transitionProperty === 'all';
flags.applyTransitionDuration = hasToStyles && (
(flags.hasTransitions && !flags.hasTransitionAll)
|| (flags.hasAnimations && !flags.hasTransitions));
@@ -1142,7 +1142,7 @@
if (options.delay != null) {
var delayStyle;
- if (typeof options.delay !== "boolean") {
+ if (typeof options.delay !== 'boolean') {
delayStyle = parseFloat(options.delay);
// number in options.delay means we have to recalculate the delay for the closing timeout
maxDelay = Math.max(delayStyle, 0);
@@ -1220,7 +1220,7 @@
close(true);
}
- function close(rejected) { // jshint ignore:line
+ function close(rejected) {
// if the promise has been called already then we shouldn't close
// the animation again
if (animationClosed || (animationCompleted && animationPaused)) return;
@@ -1247,8 +1247,11 @@
if (Object.keys(restoreStyles).length) {
forEach(restoreStyles, function(value, prop) {
- value ? node.style.setProperty(prop, value)
- : node.style.removeProperty(prop);
+ if (value) {
+ node.style.setProperty(prop, value);
+ } else {
+ node.style.removeProperty(prop);
+ }
});
}
@@ -1351,9 +1354,11 @@
animationPaused = !playAnimation;
if (timings.animationDuration) {
var value = blockKeyframeAnimations(node, animationPaused);
- animationPaused
- ? temporaryStyles.push(value)
- : removeFromArray(temporaryStyles, value);
+ if (animationPaused) {
+ temporaryStyles.push(value);
+ } else {
+ removeFromArray(temporaryStyles, value);
+ }
}
} else if (animationPaused && playAnimation) {
animationPaused = false;
@@ -1402,7 +1407,7 @@
$$jqLite.addClass(element, activeClasses);
if (flags.recalculateTimingStyles) {
- fullClassName = node.className + ' ' + preparationClasses;
+ fullClassName = node.getAttribute('class') + ' ' + preparationClasses;
cacheKey = gcsHashFn(node, fullClassName);
timings = computeTimings(node, fullClassName, cacheKey);
@@ -1420,7 +1425,7 @@
}
if (flags.applyAnimationDelay) {
- relativeDelay = typeof options.delay !== "boolean" && truthyTimingValue(options.delay)
+ relativeDelay = typeof options.delay !== 'boolean' && truthyTimingValue(options.delay)
? parseFloat(options.delay)
: relativeDelay;
@@ -1512,7 +1517,7 @@
}];
}];
-var $$AnimateCssDriverProvider = ['$$animationProvider', function($$animationProvider) {
+var $$AnimateCssDriverProvider = ['$$animationProvider', /** @this */ function($$animationProvider) {
$$animationProvider.drivers.push('$$animateCssDriver');
var NG_ANIMATE_SHIM_CLASS_NAME = 'ng-animate-shim';
@@ -1541,8 +1546,6 @@
isDocumentFragment(rootNode) || bodyNode.contains(rootNode) ? rootNode : bodyNode
);
- var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
-
return function initDriverFn(animationDetails) {
return animationDetails.from && animationDetails.to
? prepareFromToAnchorAnimation(animationDetails.from,
@@ -1784,7 +1787,7 @@
// TODO(matsko): add documentation
// by the time...
-var $$AnimateJsProvider = ['$animateProvider', function($animateProvider) {
+var $$AnimateJsProvider = ['$animateProvider', /** @this */ function($animateProvider) {
this.$get = ['$injector', '$$AnimateRunner', '$$jqLite',
function($injector, $$AnimateRunner, $$jqLite) {
@@ -1823,7 +1826,7 @@
var before, after;
if (animations.length) {
var afterFn, beforeFn;
- if (event == 'leave') {
+ if (event === 'leave') {
beforeFn = 'leave';
afterFn = 'afterLeave'; // TODO(matsko): get rid of this
} else {
@@ -2008,7 +2011,7 @@
function packageAnimations(element, event, options, animations, fnName) {
var operations = groupEventedAnimations(element, event, options, animations, fnName);
if (operations.length === 0) {
- var a,b;
+ var a, b;
if (fnName === 'beforeSetClass') {
a = groupEventedAnimations(element, 'removeClass', options, animations, 'beforeRemoveClass');
b = groupEventedAnimations(element, 'addClass', options, animations, 'beforeAddClass');
@@ -2036,11 +2039,19 @@
});
}
- runners.length ? $$AnimateRunner.all(runners, callback) : callback();
+ if (runners.length) {
+ $$AnimateRunner.all(runners, callback);
+ } else {
+ callback();
+ }
return function endFn(reject) {
forEach(runners, function(runner) {
- reject ? runner.cancel() : runner.end();
+ if (reject) {
+ runner.cancel();
+ } else {
+ runner.end();
+ }
});
};
};
@@ -2050,7 +2061,7 @@
function lookupAnimations(classes) {
classes = isArray(classes) ? classes : classes.split(' ');
var matches = [], flagMap = {};
- for (var i=0; i < classes.length; i++) {
+ for (var i = 0; i < classes.length; i++) {
var klass = classes[i],
animationFactory = $animateProvider.$$registeredAnimations[klass];
if (animationFactory && !flagMap[klass]) {
@@ -2063,7 +2074,7 @@
}];
}];
-var $$AnimateJsDriverProvider = ['$$animationProvider', function($$animationProvider) {
+var $$AnimateJsDriverProvider = ['$$animationProvider', /** @this */ function($$animationProvider) {
$$animationProvider.drivers.push('$$animateJsDriver');
this.$get = ['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner) {
return function initDriverFn(animationDetails) {
@@ -2125,7 +2136,7 @@
var NG_ANIMATE_ATTR_NAME = 'data-ng-animate';
var NG_ANIMATE_PIN_DATA = '$ngAnimatePin';
-var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
+var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animateProvider) {
var PRE_DIGEST_STATE = 1;
var RUNNING_STATE = 2;
var ONE_SPACE = ' ';
@@ -2159,9 +2170,9 @@
}
}
- function isAllowed(ruleType, element, currentAnimation, previousAnimation) {
+ function isAllowed(ruleType, currentAnimation, previousAnimation) {
return rules[ruleType].some(function(fn) {
- return fn(element, currentAnimation, previousAnimation);
+ return fn(currentAnimation, previousAnimation);
});
}
@@ -2171,40 +2182,40 @@
return and ? a && b : a || b;
}
- rules.join.push(function(element, newAnimation, currentAnimation) {
+ rules.join.push(function(newAnimation, currentAnimation) {
// if the new animation is class-based then we can just tack that on
return !newAnimation.structural && hasAnimationClasses(newAnimation);
});
- rules.skip.push(function(element, newAnimation, currentAnimation) {
+ rules.skip.push(function(newAnimation, currentAnimation) {
// there is no need to animate anything if no classes are being added and
// there is no structural animation that will be triggered
return !newAnimation.structural && !hasAnimationClasses(newAnimation);
});
- rules.skip.push(function(element, newAnimation, currentAnimation) {
+ rules.skip.push(function(newAnimation, currentAnimation) {
// why should we trigger a new structural animation if the element will
// be removed from the DOM anyway?
- return currentAnimation.event == 'leave' && newAnimation.structural;
+ return currentAnimation.event === 'leave' && newAnimation.structural;
});
- rules.skip.push(function(element, newAnimation, currentAnimation) {
+ rules.skip.push(function(newAnimation, currentAnimation) {
// if there is an ongoing current animation then don't even bother running the class-based animation
return currentAnimation.structural && currentAnimation.state === RUNNING_STATE && !newAnimation.structural;
});
- rules.cancel.push(function(element, newAnimation, currentAnimation) {
+ rules.cancel.push(function(newAnimation, currentAnimation) {
// there can never be two structural animations running at the same time
return currentAnimation.structural && newAnimation.structural;
});
- rules.cancel.push(function(element, newAnimation, currentAnimation) {
+ rules.cancel.push(function(newAnimation, currentAnimation) {
// if the previous animation is already running, but the new animation will
// be triggered, but the new animation is structural
return currentAnimation.state === RUNNING_STATE && newAnimation.structural;
});
- rules.cancel.push(function(element, newAnimation, currentAnimation) {
+ rules.cancel.push(function(newAnimation, currentAnimation) {
// cancel the animation if classes added / removed in both animation cancel each other out,
// but only if the current animation isn't structural
@@ -2223,13 +2234,15 @@
return hasMatchingClasses(nA, cR) || hasMatchingClasses(nR, cA);
});
- this.$get = ['$$rAF', '$rootScope', '$rootElement', '$document', '$$HashMap',
+ this.$get = ['$$rAF', '$rootScope', '$rootElement', '$document', '$$Map',
'$$animation', '$$AnimateRunner', '$templateRequest', '$$jqLite', '$$forceReflow',
- function($$rAF, $rootScope, $rootElement, $document, $$HashMap,
- $$animation, $$AnimateRunner, $templateRequest, $$jqLite, $$forceReflow) {
+ '$$isDocumentHidden',
+ function($$rAF, $rootScope, $rootElement, $document, $$Map,
+ $$animation, $$AnimateRunner, $templateRequest, $$jqLite, $$forceReflow,
+ $$isDocumentHidden) {
- var activeAnimationsLookup = new $$HashMap();
- var disabledElementsLookup = new $$HashMap();
+ var activeAnimationsLookup = new $$Map();
+ var disabledElementsLookup = new $$Map();
var animationsEnabled = null;
function postDigestTaskFactory() {
@@ -2297,16 +2310,12 @@
}
// IE9-11 has no method "contains" in SVG element and in Node.prototype. Bug #10259.
- var contains = window.Node.prototype.contains || function(arg) {
- // jshint bitwise: false
+ var contains = window.Node.prototype.contains || /** @this */ function(arg) {
+ // eslint-disable-next-line no-bitwise
return this === arg || !!(this.compareDocumentPosition(arg) & 16);
- // jshint bitwise: true
};
- function findCallbacks(parent, element, event) {
- var targetNode = getDomNode(element);
- var targetParentNode = getDomNode(parent);
-
+ function findCallbacks(targetParentNode, targetNode, event) {
var matches = [];
var entries = callbackRegistry[event];
if (entries) {
@@ -2331,11 +2340,11 @@
});
}
- function cleanupEventListeners(phase, element) {
- if (phase === 'close' && !element[0].parentNode) {
+ function cleanupEventListeners(phase, node) {
+ if (phase === 'close' && !node.parentNode) {
// If the element is not attached to a parentNode, it has been removed by
// the domOperation, and we can safely remove the event callbacks
- $animate.off(element);
+ $animate.off(node);
}
}
@@ -2416,7 +2425,7 @@
bool = !disabledElementsLookup.get(node);
} else {
// (element, bool) - Element setter
- disabledElementsLookup.put(node, !bool);
+ disabledElementsLookup.set(node, !bool);
}
}
}
@@ -2427,18 +2436,15 @@
return $animate;
- function queueAnimation(element, event, initialOptions) {
+ function queueAnimation(originalElement, event, initialOptions) {
// we always make a copy of the options since
// there should never be any side effects on
// the input data when running `$animateCss`.
var options = copy(initialOptions);
- var node, parent;
- element = stripCommentsFromElement(element);
- if (element) {
- node = getDomNode(element);
- parent = element.parent();
- }
+ var element = stripCommentsFromElement(originalElement);
+ var node = getDomNode(element);
+ var parentNode = node && node.parentNode;
options = prepareAnimationOptions(options);
@@ -2481,7 +2487,7 @@
return runner;
}
- var className = [node.className, options.addClass, options.removeClass].join(' ');
+ var className = [node.getAttribute('class'), options.addClass, options.removeClass].join(' ');
if (!isAnimatableClassName(className)) {
close();
return runner;
@@ -2489,7 +2495,7 @@
var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;
- var documentHidden = $document[0].hidden;
+ var documentHidden = $$isDocumentHidden();
// this is a hard disable of all animations for the application or on
// the element itself, therefore there is no need to continue further
@@ -2502,8 +2508,8 @@
// there is no point in traversing the same collection of parent ancestors if a followup
// animation will be run on the same element that already did all that checking work
- if (!skipAnimations && (!hasExistingAnimation || existingAnimation.state != PRE_DIGEST_STATE)) {
- skipAnimations = !areAnimationsAllowed(element, parent, event);
+ if (!skipAnimations && (!hasExistingAnimation || existingAnimation.state !== PRE_DIGEST_STATE)) {
+ skipAnimations = !areAnimationsAllowed(node, parentNode, event);
}
if (skipAnimations) {
@@ -2515,7 +2521,7 @@
}
if (isStructural) {
- closeChildAnimations(element);
+ closeChildAnimations(node);
}
var newAnimation = {
@@ -2530,7 +2536,7 @@
};
if (hasExistingAnimation) {
- var skipAnimationFlag = isAllowed('skip', element, newAnimation, existingAnimation);
+ var skipAnimationFlag = isAllowed('skip', newAnimation, existingAnimation);
if (skipAnimationFlag) {
if (existingAnimation.state === RUNNING_STATE) {
close();
@@ -2540,7 +2546,7 @@
return existingAnimation.runner;
}
}
- var cancelAnimationFlag = isAllowed('cancel', element, newAnimation, existingAnimation);
+ var cancelAnimationFlag = isAllowed('cancel', newAnimation, existingAnimation);
if (cancelAnimationFlag) {
if (existingAnimation.state === RUNNING_STATE) {
// this will end the animation right away and it is safe
@@ -2562,7 +2568,7 @@
// a joined animation means that this animation will take over the existing one
// so an example would involve a leave animation taking over an enter. Then when
// the postDigest kicks in the enter will be ignored.
- var joinAnimationFlag = isAllowed('join', element, newAnimation, existingAnimation);
+ var joinAnimationFlag = isAllowed('join', newAnimation, existingAnimation);
if (joinAnimationFlag) {
if (existingAnimation.state === RUNNING_STATE) {
normalizeAnimationDetails(element, newAnimation);
@@ -2596,7 +2602,7 @@
if (!isValidAnimation) {
close();
- clearElementAnimationState(element);
+ clearElementAnimationState(node);
return runner;
}
@@ -2604,9 +2610,18 @@
var counter = (existingAnimation.counter || 0) + 1;
newAnimation.counter = counter;
- markElementAnimationState(element, PRE_DIGEST_STATE, newAnimation);
+ markElementAnimationState(node, PRE_DIGEST_STATE, newAnimation);
$rootScope.$$postDigest(function() {
+ // It is possible that the DOM nodes inside `originalElement` have been replaced. This can
+ // happen if the animated element is a transcluded clone and also has a `templateUrl`
+ // directive on it. Therefore, we must recreate `element` in order to interact with the
+ // actual DOM nodes.
+ // Note: We still need to use the old `node` for certain things, such as looking up in
+ // HashMaps where it was used as the key.
+
+ element = stripCommentsFromElement(originalElement);
+
var animationDetails = activeAnimationsLookup.get(node);
var animationCancelled = !animationDetails;
animationDetails = animationDetails || {};
@@ -2645,7 +2660,7 @@
// isn't allowed to animate from here then we need to clear the state of the element
// so that any future animations won't read the expired animation data.
if (!isValidAnimation) {
- clearElementAnimationState(element);
+ clearElementAnimationState(node);
}
return;
@@ -2657,7 +2672,7 @@
? 'setClass'
: animationDetails.event;
- markElementAnimationState(element, RUNNING_STATE);
+ markElementAnimationState(node, RUNNING_STATE);
var realRunner = $$animation(element, event, animationDetails.options);
// this will update the runner's flow-control events based on
@@ -2669,7 +2684,7 @@
close(!status);
var animationDetails = activeAnimationsLookup.get(node);
if (animationDetails && animationDetails.counter === counter) {
- clearElementAnimationState(getDomNode(element));
+ clearElementAnimationState(node);
}
notifyProgress(runner, event, 'close', {});
});
@@ -2679,7 +2694,7 @@
function notifyProgress(runner, event, phase, data) {
runInNextPostDigestOrNow(function() {
- var callbacks = findCallbacks(parent, element, event);
+ var callbacks = findCallbacks(parentNode, node, event);
if (callbacks.length) {
// do not optimize this call here to RAF because
// we don't know how heavy the callback code here will
@@ -2689,16 +2704,16 @@
forEach(callbacks, function(callback) {
callback(element, phase, data);
});
- cleanupEventListeners(phase, element);
+ cleanupEventListeners(phase, node);
});
} else {
- cleanupEventListeners(phase, element);
+ cleanupEventListeners(phase, node);
}
});
runner.progress(event, phase, data);
}
- function close(reject) { // jshint ignore:line
+ function close(reject) {
clearGeneratedClasses(element, options);
applyAnimationClasses(element, options);
applyAnimationStyles(element, options);
@@ -2707,11 +2722,10 @@
}
}
- function closeChildAnimations(element) {
- var node = getDomNode(element);
+ function closeChildAnimations(node) {
var children = node.querySelectorAll('[' + NG_ANIMATE_ATTR_NAME + ']');
forEach(children, function(child) {
- var state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME));
+ var state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME), 10);
var animationDetails = activeAnimationsLookup.get(child);
if (animationDetails) {
switch (state) {
@@ -2719,21 +2733,16 @@
animationDetails.runner.end();
/* falls through */
case PRE_DIGEST_STATE:
- activeAnimationsLookup.remove(child);
+ activeAnimationsLookup.delete(child);
break;
}
}
});
}
- function clearElementAnimationState(element) {
- var node = getDomNode(element);
+ function clearElementAnimationState(node) {
node.removeAttribute(NG_ANIMATE_ATTR_NAME);
- activeAnimationsLookup.remove(node);
- }
-
- function isMatchingElement(nodeOrElmA, nodeOrElmB) {
- return getDomNode(nodeOrElmA) === getDomNode(nodeOrElmB);
+ activeAnimationsLookup.delete(node);
}
/**
@@ -2743,54 +2752,54 @@
* c) the element is not a child of the body
* d) the element is not a child of the $rootElement
*/
- function areAnimationsAllowed(element, parentElement, event) {
- var bodyElement = jqLite($document[0].body);
- var bodyElementDetected = isMatchingElement(element, bodyElement) || element[0].nodeName === 'HTML';
- var rootElementDetected = isMatchingElement(element, $rootElement);
- var parentAnimationDetected = false;
- var animateChildren;
- var elementDisabled = disabledElementsLookup.get(getDomNode(element));
+ function areAnimationsAllowed(node, parentNode, event) {
+ var bodyNode = $document[0].body;
+ var rootNode = getDomNode($rootElement);
- var parentHost = jqLite.data(element[0], NG_ANIMATE_PIN_DATA);
+ var bodyNodeDetected = (node === bodyNode) || node.nodeName === 'HTML';
+ var rootNodeDetected = (node === rootNode);
+ var parentAnimationDetected = false;
+ var elementDisabled = disabledElementsLookup.get(node);
+ var animateChildren;
+
+ var parentHost = jqLite.data(node, NG_ANIMATE_PIN_DATA);
if (parentHost) {
- parentElement = parentHost;
+ parentNode = getDomNode(parentHost);
}
- parentElement = getDomNode(parentElement);
-
- while (parentElement) {
- if (!rootElementDetected) {
+ while (parentNode) {
+ if (!rootNodeDetected) {
// 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);
+ rootNodeDetected = (parentNode === rootNode);
}
- if (parentElement.nodeType !== ELEMENT_NODE) {
+ if (parentNode.nodeType !== ELEMENT_NODE) {
// no point in inspecting the #document element
break;
}
- var details = activeAnimationsLookup.get(parentElement) || {};
+ var details = activeAnimationsLookup.get(parentNode) || {};
// 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(parentElement);
+ var parentNodeDisabled = disabledElementsLookup.get(parentNode);
- if (parentElementDisabled === true && elementDisabled !== false) {
+ if (parentNodeDisabled === true && elementDisabled !== false) {
// disable animations if the user hasn't explicitly enabled animations on the
// current element
elementDisabled = true;
// element is disabled via parent element, no need to check anything else
break;
- } else if (parentElementDisabled === false) {
+ } else if (parentNodeDisabled === false) {
elementDisabled = false;
}
parentAnimationDetected = details.structural;
}
if (isUndefined(animateChildren) || animateChildren === true) {
- var value = jqLite.data(parentElement, NG_ANIMATE_CHILDREN_DATA);
+ var value = jqLite.data(parentNode, NG_ANIMATE_CHILDREN_DATA);
if (isDefined(value)) {
animateChildren = value;
}
@@ -2799,52 +2808,53 @@
// there is no need to continue traversing at this point
if (parentAnimationDetected && animateChildren === false) break;
- if (!bodyElementDetected) {
+ if (!bodyNodeDetected) {
// we also need to ensure that the element is or will be a part of the body element
// otherwise it is pointless to even issue an animation to be rendered
- bodyElementDetected = isMatchingElement(parentElement, bodyElement);
+ bodyNodeDetected = (parentNode === bodyNode);
}
- if (bodyElementDetected && rootElementDetected) {
+ if (bodyNodeDetected && rootNodeDetected) {
// If both body and root have been found, any other checks are pointless,
// as no animation data should live outside the application
break;
}
- if (!rootElementDetected) {
- // If no rootElement is detected, check if the parentElement is pinned to another element
- parentHost = jqLite.data(parentElement, NG_ANIMATE_PIN_DATA);
+ if (!rootNodeDetected) {
+ // If `rootNode` is not detected, check if `parentNode` is pinned to another element
+ parentHost = jqLite.data(parentNode, NG_ANIMATE_PIN_DATA);
if (parentHost) {
// The pin target element becomes the next parent element
- parentElement = getDomNode(parentHost);
+ parentNode = getDomNode(parentHost);
continue;
}
}
- parentElement = parentElement.parentNode;
+ parentNode = parentNode.parentNode;
}
var allowAnimation = (!parentAnimationDetected || animateChildren) && elementDisabled !== true;
- return allowAnimation && rootElementDetected && bodyElementDetected;
+ return allowAnimation && rootNodeDetected && bodyNodeDetected;
}
- function markElementAnimationState(element, state, details) {
+ function markElementAnimationState(node, state, details) {
details = details || {};
details.state = state;
- var node = getDomNode(element);
node.setAttribute(NG_ANIMATE_ATTR_NAME, state);
var oldValue = activeAnimationsLookup.get(node);
var newValue = oldValue
? extend(oldValue, details)
: details;
- activeAnimationsLookup.put(node, newValue);
+ activeAnimationsLookup.set(node, newValue);
}
}];
}];
-var $$AnimationProvider = ['$animateProvider', function($animateProvider) {
+/* exported $$AnimationProvider */
+
+var $$AnimationProvider = ['$animateProvider', /** @this */ function($animateProvider) {
var NG_ANIMATE_REF_ATTR = 'ng-animate-ref';
var drivers = this.drivers = [];
@@ -2863,21 +2873,21 @@
return element.data(RUNNER_STORAGE_KEY);
}
- this.$get = ['$$jqLite', '$rootScope', '$injector', '$$AnimateRunner', '$$HashMap', '$$rAFScheduler',
- function($$jqLite, $rootScope, $injector, $$AnimateRunner, $$HashMap, $$rAFScheduler) {
+ this.$get = ['$$jqLite', '$rootScope', '$injector', '$$AnimateRunner', '$$Map', '$$rAFScheduler',
+ function($$jqLite, $rootScope, $injector, $$AnimateRunner, $$Map, $$rAFScheduler) {
var animationQueue = [];
var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
function sortAnimations(animations) {
var tree = { children: [] };
- var i, lookup = new $$HashMap();
+ var i, lookup = new $$Map();
- // this is done first beforehand so that the hashmap
+ // this is done first beforehand so that the map
// is filled with a list of the elements that will be animated
for (i = 0; i < animations.length; i++) {
var animation = animations[i];
- lookup.put(animation.domNode, animations[i] = {
+ lookup.set(animation.domNode, animations[i] = {
domNode: animation.domNode,
fn: animation.fn,
children: []
@@ -2896,7 +2906,7 @@
var elementNode = entry.domNode;
var parentNode = elementNode.parentNode;
- lookup.put(elementNode, entry);
+ lookup.set(elementNode, entry);
var parentEntry;
while (parentNode) {
@@ -3232,7 +3242,7 @@
}
}
- function close(rejected) { // jshint ignore:line
+ function close(rejected) {
element.off('$destroy', handleDestroyedElement);
removeRunner(element);
@@ -3403,7 +3413,7 @@
* ## CSS-based Animations
*
* CSS-based animations with ngAnimate are unique since they require no JavaScript code at all. By using a CSS class that we reference between our HTML
- * and CSS code we can create an animation that will be picked up by Angular when an the underlying directive performs an operation.
+ * and CSS code we can create an animation that will be picked up by Angular when an underlying directive performs an operation.
*
* The example below shows how an `enter` animation can be made possible on an element using `ng-if`:
*
@@ -3543,6 +3553,10 @@
* /* As of 1.4.4, this must always be set: it signals ngAnimate
* to not accidentally inherit a delay property from another CSS class */
* transition-duration: 0s;
+ *
+ * /* if you are using animations instead of transitions you should configure as follows:
+ * animation-delay: 0.1s;
+ * animation-duration: 0s; */
* }
* .my-animation.ng-enter.ng-enter-active {
* /* standard transition styles */
@@ -3898,7 +3912,7 @@
deps="angular-animate.js;angular-route.js"
animations="true">
<file name="index.html">
- <a href="#/">Home</a>
+ <a href="#!/">Home</a>
<hr />
<div class="view-container">
<div ng-view class="view"></div>
@@ -3918,22 +3932,23 @@
}])
.run(['$rootScope', function($rootScope) {
$rootScope.records = [
- { id:1, title: "Miss Beulah Roob" },
- { id:2, title: "Trent Morissette" },
- { id:3, title: "Miss Ava Pouros" },
- { id:4, title: "Rod Pouros" },
- { id:5, title: "Abdul Rice" },
- { id:6, title: "Laurie Rutherford Sr." },
- { id:7, title: "Nakia McLaughlin" },
- { id:8, title: "Jordon Blanda DVM" },
- { id:9, title: "Rhoda Hand" },
- { id:10, title: "Alexandrea Sauer" }
+ { id: 1, title: 'Miss Beulah Roob' },
+ { id: 2, title: 'Trent Morissette' },
+ { id: 3, title: 'Miss Ava Pouros' },
+ { id: 4, title: 'Rod Pouros' },
+ { id: 5, title: 'Abdul Rice' },
+ { id: 6, title: 'Laurie Rutherford Sr.' },
+ { id: 7, title: 'Nakia McLaughlin' },
+ { id: 8, title: 'Jordon Blanda DVM' },
+ { id: 9, title: 'Rhoda Hand' },
+ { id: 10, title: 'Alexandrea Sauer' }
];
}])
.controller('HomeController', [function() {
//empty
}])
- .controller('ProfileController', ['$rootScope', '$routeParams', function($rootScope, $routeParams) {
+ .controller('ProfileController', ['$rootScope', '$routeParams',
+ function ProfileController($rootScope, $routeParams) {
var index = parseInt($routeParams.id, 10);
var record = $rootScope.records[index - 1];
@@ -3945,7 +3960,7 @@
<h2>Welcome to the home page</h1>
<p>Please click on an element</p>
<a class="record"
- ng-href="#/profile/{{ record.id }}"
+ ng-href="#!/profile/{{ record.id }}"
ng-animate-ref="{{ record.id }}"
ng-repeat="record in records">
{{ record.title }}
@@ -4121,6 +4136,7 @@
isFunction = angular.isFunction;
isElement = angular.isElement;
})
+ .info({ angularVersion: '1.6.4' })
.directive('ngAnimateSwap', ngAnimateSwapDirective)
.directive('ngAnimateChildren', $$AnimateChildrenDirective)
@@ -4136,4 +4152,4 @@
.provider('$$animateJsDriver', $$AnimateJsDriverProvider);
-})(window, window.angular);
+})(window, window.angular);
\ No newline at end of file