Update to angular 1.3.7

This commit is contained in:
Tankred Hase 2014-12-19 12:00:32 +01:00
parent 6a9603cb69
commit 3cc0a372e1
4 changed files with 1225 additions and 890 deletions

View File

@ -1,5 +1,5 @@
/**
* @license AngularJS v1.3.2
* @license AngularJS v1.3.7
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
@ -19,7 +19,7 @@
* # Usage
*
* To see animations in action, all that is required is to define the appropriate CSS classes
* or to register a JavaScript animation via the myModule.animation() function. The directives that support animation automatically are:
* or to register a JavaScript animation via the `myModule.animation()` function. The directives that support animation automatically are:
* `ngRepeat`, `ngInclude`, `ngIf`, `ngSwitch`, `ngShow`, `ngHide`, `ngView` and `ngClass`. Custom directives can take advantage of animation
* by using the `$animate` service.
*
@ -161,8 +161,8 @@
* ### Structural transition animations
*
* Structural transitions (such as enter, leave and move) will always apply a `0s none` transition
* value to force the browser into rendering the styles defined in the setup (.ng-enter, .ng-leave
* or .ng-move) class. This means that any active transition animations operating on the element
* value to force the browser into rendering the styles defined in the setup (`.ng-enter`, `.ng-leave`
* or `.ng-move`) class. This means that any active transition animations operating on the element
* will be cut off to make way for the enter, leave or move animation.
*
* ### Class-based transition animations
@ -245,7 +245,7 @@
* You then configure `$animate` to enforce this prefix:
*
* ```js
* $animateProvider.classNamePrefix(/animate-/);
* $animateProvider.classNameFilter(/animate-/);
* ```
* </div>
*
@ -479,11 +479,12 @@ angular.module('ngAnimate', ['ng'])
function isMatchingElement(elm1, elm2) {
return extractElementNode(elm1) == extractElementNode(elm2);
}
var $$jqLite;
$provide.decorator('$animate',
['$delegate', '$$q', '$injector', '$sniffer', '$rootElement', '$$asyncCallback', '$rootScope', '$document', '$templateRequest',
function($delegate, $$q, $injector, $sniffer, $rootElement, $$asyncCallback, $rootScope, $document, $templateRequest) {
['$delegate', '$$q', '$injector', '$sniffer', '$rootElement', '$$asyncCallback', '$rootScope', '$document', '$templateRequest', '$$jqLite',
function($delegate, $$q, $injector, $sniffer, $rootElement, $$asyncCallback, $rootScope, $document, $templateRequest, $$$jqLite) {
$$jqLite = $$$jqLite;
$rootElement.data(NG_ANIMATE_STATE, rootAnimateState);
// Wait until all directive and route-related templates are downloaded and
@ -877,22 +878,22 @@ angular.module('ngAnimate', ['ng'])
*
* Below is a breakdown of each step that occurs during the `animate` animation:
*
* | Animation Step | What the element class attribute looks like |
* |-------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|
* | 1. $animate.animate(...) is called | class="my-animation" |
* | 2. $animate waits for the next digest to start the animation | class="my-animation ng-animate" |
* | 3. $animate runs the JavaScript-defined animations detected on the element | class="my-animation ng-animate" |
* | 4. the className class value is added to the element | class="my-animation ng-animate className" |
* | 5. $animate scans the element styles to get the CSS transition/animation duration and delay | class="my-animation ng-animate className" |
* | 6. $animate blocks all CSS transitions on the element to ensure the .className class styling is applied right away| class="my-animation ng-animate className" |
* | 7. $animate applies the provided collection of `from` CSS styles to the element | class="my-animation ng-animate className" |
* | 8. $animate waits for a single animation frame (this performs a reflow) | class="my-animation ng-animate className" |
* | 9. $animate removes the CSS transition block placed on the element | class="my-animation ng-animate className" |
* | 10. the className-active class is added (this triggers the CSS transition/animation) | class="my-animation ng-animate className className-active" |
* | 11. $animate applies the collection of `to` CSS styles to the element which are then handled by the transition | class="my-animation ng-animate className className-active" |
* | 12. $animate waits for the animation to complete (via events and timeout) | class="my-animation ng-animate className className-active" |
* | 13. The animation ends and all generated CSS classes are removed from the element | class="my-animation" |
* | 14. The returned promise is resolved. | class="my-animation" |
* | Animation Step | What the element class attribute looks like |
* |-----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
* | 1. `$animate.animate(...)` is called | `class="my-animation"` |
* | 2. `$animate` waits for the next digest to start the animation | `class="my-animation ng-animate"` |
* | 3. `$animate` runs the JavaScript-defined animations detected on the element | `class="my-animation ng-animate"` |
* | 4. the `className` class value is added to the element | `class="my-animation ng-animate className"` |
* | 5. `$animate` scans the element styles to get the CSS transition/animation duration and delay | `class="my-animation ng-animate className"` |
* | 6. `$animate` blocks all CSS transitions on the element to ensure the `.className` class styling is applied right away| `class="my-animation ng-animate className"` |
* | 7. `$animate` applies the provided collection of `from` CSS styles to the element | `class="my-animation ng-animate className"` |
* | 8. `$animate` waits for a single animation frame (this performs a reflow) | `class="my-animation ng-animate className"` |
* | 9. `$animate` removes the CSS transition block placed on the element | `class="my-animation ng-animate className"` |
* | 10. the `className-active` class is added (this triggers the CSS transition/animation) | `class="my-animation ng-animate className className-active"` |
* | 11. `$animate` applies the collection of `to` CSS styles to the element which are then handled by the transition | `class="my-animation ng-animate className className-active"` |
* | 12. `$animate` waits for the animation to complete (via events and timeout) | `class="my-animation ng-animate className className-active"` |
* | 13. The animation ends and all generated CSS classes are removed from the element | `class="my-animation"` |
* | 14. The returned promise is resolved. | `class="my-animation"` |
*
* @param {DOMElement} element the element that will be the focus of the enter animation
* @param {object} from a collection of CSS styles that will be applied to the element at the start of the animation
@ -923,21 +924,21 @@ angular.module('ngAnimate', ['ng'])
*
* Below is a breakdown of each step that occurs during enter animation:
*
* | Animation Step | What the element class attribute looks like |
* |-------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
* | 1. $animate.enter(...) is called | class="my-animation" |
* | 2. element is inserted into the parentElement element or beside the afterElement element | class="my-animation" |
* | 3. $animate waits for the next digest to start the animation | class="my-animation ng-animate" |
* | 4. $animate runs the JavaScript-defined animations detected on the element | class="my-animation ng-animate" |
* | 5. the .ng-enter class is added to the element | class="my-animation ng-animate ng-enter" |
* | 6. $animate scans the element styles to get the CSS transition/animation duration and delay | class="my-animation ng-animate ng-enter" |
* | 7. $animate blocks all CSS transitions on the element to ensure the .ng-enter class styling is applied right away | class="my-animation ng-animate ng-enter" |
* | 8. $animate waits for a single animation frame (this performs a reflow) | class="my-animation ng-animate ng-enter" |
* | 9. $animate removes the CSS transition block placed on the element | class="my-animation ng-animate ng-enter" |
* | 10. the .ng-enter-active class is added (this triggers the CSS transition/animation) | class="my-animation ng-animate ng-enter ng-enter-active" |
* | 11. $animate waits for the animation to complete (via events and timeout) | class="my-animation ng-animate ng-enter ng-enter-active" |
* | 12. The animation ends and all generated CSS classes are removed from the element | class="my-animation" |
* | 13. The returned promise is resolved. | class="my-animation" |
* | Animation Step | What the element class attribute looks like |
* |-----------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|
* | 1. `$animate.enter(...)` is called | `class="my-animation"` |
* | 2. element is inserted into the `parentElement` element or beside the `afterElement` element | `class="my-animation"` |
* | 3. `$animate` waits for the next digest to start the animation | `class="my-animation ng-animate"` |
* | 4. `$animate` runs the JavaScript-defined animations detected on the element | `class="my-animation ng-animate"` |
* | 5. the `.ng-enter` class is added to the element | `class="my-animation ng-animate ng-enter"` |
* | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay | `class="my-animation ng-animate ng-enter"` |
* | 7. `$animate` blocks all CSS transitions on the element to ensure the `.ng-enter` class styling is applied right away | `class="my-animation ng-animate ng-enter"` |
* | 8. `$animate` waits for a single animation frame (this performs a reflow) | `class="my-animation ng-animate ng-enter"` |
* | 9. `$animate` removes the CSS transition block placed on the element | `class="my-animation ng-animate ng-enter"` |
* | 10. the `.ng-enter-active` class is added (this triggers the CSS transition/animation) | `class="my-animation ng-animate ng-enter ng-enter-active"` |
* | 11. `$animate` waits for the animation to complete (via events and timeout) | `class="my-animation ng-animate ng-enter ng-enter-active"` |
* | 12. The animation ends and all generated CSS classes are removed from the element | `class="my-animation"` |
* | 13. The returned promise is resolved. | `class="my-animation"` |
*
* @param {DOMElement} element the element that will be the focus of the enter animation
* @param {DOMElement} parentElement the parent element of the element that will be the focus of the enter animation
@ -969,21 +970,21 @@ angular.module('ngAnimate', ['ng'])
*
* Below is a breakdown of each step that occurs during leave animation:
*
* | Animation Step | What the element class attribute looks like |
* |-------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
* | 1. $animate.leave(...) is called | class="my-animation" |
* | 2. $animate runs the JavaScript-defined animations detected on the element | class="my-animation ng-animate" |
* | 3. $animate waits for the next digest to start the animation | class="my-animation ng-animate" |
* | 4. the .ng-leave class is added to the element | class="my-animation ng-animate ng-leave" |
* | 5. $animate scans the element styles to get the CSS transition/animation duration and delay | class="my-animation ng-animate ng-leave" |
* | 6. $animate blocks all CSS transitions on the element to ensure the .ng-leave class styling is applied right away | class="my-animation ng-animate ng-leave |
* | 7. $animate waits for a single animation frame (this performs a reflow) | class="my-animation ng-animate ng-leave" |
* | 8. $animate removes the CSS transition block placed on the element | class="my-animation ng-animate ng-leave |
* | 9. the .ng-leave-active class is added (this triggers the CSS transition/animation) | class="my-animation ng-animate ng-leave ng-leave-active" |
* | 10. $animate waits for the animation to complete (via events and timeout) | class="my-animation ng-animate ng-leave ng-leave-active" |
* | 11. The animation ends and all generated CSS classes are removed from the element | class="my-animation" |
* | 12. The element is removed from the DOM | ... |
* | 13. The returned promise is resolved. | ... |
* | Animation Step | What the element class attribute looks like |
* |-----------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|
* | 1. `$animate.leave(...)` is called | `class="my-animation"` |
* | 2. `$animate` runs the JavaScript-defined animations detected on the element | `class="my-animation ng-animate"` |
* | 3. `$animate` waits for the next digest to start the animation | `class="my-animation ng-animate"` |
* | 4. the `.ng-leave` class is added to the element | `class="my-animation ng-animate ng-leave"` |
* | 5. `$animate` scans the element styles to get the CSS transition/animation duration and delay | `class="my-animation ng-animate ng-leave"` |
* | 6. `$animate` blocks all CSS transitions on the element to ensure the `.ng-leave` class styling is applied right away | `class="my-animation ng-animate ng-leave"` |
* | 7. `$animate` waits for a single animation frame (this performs a reflow) | `class="my-animation ng-animate ng-leave"` |
* | 8. `$animate` removes the CSS transition block placed on the element | `class="my-animation ng-animate ng-leave"` |
* | 9. the `.ng-leave-active` class is added (this triggers the CSS transition/animation) | `class="my-animation ng-animate ng-leave ng-leave-active"` |
* | 10. `$animate` waits for the animation to complete (via events and timeout) | `class="my-animation ng-animate ng-leave ng-leave-active"` |
* | 11. The animation ends and all generated CSS classes are removed from the element | `class="my-animation"` |
* | 12. The element is removed from the DOM | ... |
* | 13. The returned promise is resolved. | ... |
*
* @param {DOMElement} element the element that will be the focus of the leave animation
* @param {object=} options an optional collection of styles that will be picked up by the CSS transition/animation
@ -1014,21 +1015,21 @@ angular.module('ngAnimate', ['ng'])
*
* Below is a breakdown of each step that occurs during move animation:
*
* | Animation Step | What the element class attribute looks like |
* |------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------|
* | 1. $animate.move(...) is called | class="my-animation" |
* | 2. element is moved into the parentElement element or beside the afterElement element | class="my-animation" |
* | 3. $animate waits for the next digest to start the animation | class="my-animation ng-animate" |
* | 4. $animate runs the JavaScript-defined animations detected on the element | class="my-animation ng-animate" |
* | 5. the .ng-move class is added to the element | class="my-animation ng-animate ng-move" |
* | 6. $animate scans the element styles to get the CSS transition/animation duration and delay | class="my-animation ng-animate ng-move" |
* | 7. $animate blocks all CSS transitions on the element to ensure the .ng-move class styling is applied right away | class="my-animation ng-animate ng-move |
* | 8. $animate waits for a single animation frame (this performs a reflow) | class="my-animation ng-animate ng-move" |
* | 9. $animate removes the CSS transition block placed on the element | class="my-animation ng-animate ng-move |
* | 10. the .ng-move-active class is added (this triggers the CSS transition/animation) | class="my-animation ng-animate ng-move ng-move-active" |
* | 11. $animate waits for the animation to complete (via events and timeout) | class="my-animation ng-animate ng-move ng-move-active" |
* | 12. The animation ends and all generated CSS classes are removed from the element | class="my-animation" |
* | 13. The returned promise is resolved. | class="my-animation" |
* | Animation Step | What the element class attribute looks like |
* |----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
* | 1. `$animate.move(...)` is called | `class="my-animation"` |
* | 2. element is moved into the parentElement element or beside the afterElement element | `class="my-animation"` |
* | 3. `$animate` waits for the next digest to start the animation | `class="my-animation ng-animate"` |
* | 4. `$animate` runs the JavaScript-defined animations detected on the element | `class="my-animation ng-animate"` |
* | 5. the `.ng-move` class is added to the element | `class="my-animation ng-animate ng-move"` |
* | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay | `class="my-animation ng-animate ng-move"` |
* | 7. `$animate` blocks all CSS transitions on the element to ensure the `.ng-move` class styling is applied right away | `class="my-animation ng-animate ng-move"` |
* | 8. `$animate` waits for a single animation frame (this performs a reflow) | `class="my-animation ng-animate ng-move"` |
* | 9. `$animate` removes the CSS transition block placed on the element | `class="my-animation ng-animate ng-move"` |
* | 10. the `.ng-move-active` class is added (this triggers the CSS transition/animation) | `class="my-animation ng-animate ng-move ng-move-active"` |
* | 11. `$animate` waits for the animation to complete (via events and timeout) | `class="my-animation ng-animate ng-move ng-move-active"` |
* | 12. The animation ends and all generated CSS classes are removed from the element | `class="my-animation"` |
* | 13. The returned promise is resolved. | `class="my-animation"` |
*
* @param {DOMElement} element the element that will be the focus of the move animation
* @param {DOMElement} parentElement the parentElement element of the element that will be the focus of the move animation
@ -1062,18 +1063,18 @@ angular.module('ngAnimate', ['ng'])
*
* Below is a breakdown of each step that occurs during addClass animation:
*
* | Animation Step | What the element class attribute looks like |
* |----------------------------------------------------------------------------------------------------|------------------------------------------------------------------|
* | 1. $animate.addClass(element, 'super') is called | class="my-animation" |
* | 2. $animate runs the JavaScript-defined animations detected on the element | class="my-animation ng-animate" |
* | 3. the .super-add class is added to the element | class="my-animation ng-animate super-add" |
* | 4. $animate waits for a single animation frame (this performs a reflow) | class="my-animation ng-animate super-add" |
* | 5. the .super and .super-add-active classes are added (this triggers the CSS transition/animation) | class="my-animation ng-animate super super-add super-add-active" |
* | 6. $animate scans the element styles to get the CSS transition/animation duration and delay | class="my-animation ng-animate super-add" |
* | 7. $animate waits for the animation to complete (via events and timeout) | class="my-animation super super-add super-add-active" |
* | 8. The animation ends and all generated CSS classes are removed from the element | class="my-animation super" |
* | 9. The super class is kept on the element | class="my-animation super" |
* | 10. The returned promise is resolved. | class="my-animation super" |
* | Animation Step | What the element class attribute looks like |
* |--------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|
* | 1. `$animate.addClass(element, 'super')` is called | `class="my-animation"` |
* | 2. `$animate` runs the JavaScript-defined animations detected on the element | `class="my-animation ng-animate"` |
* | 3. the `.super-add` class is added to the element | `class="my-animation ng-animate super-add"` |
* | 4. `$animate` waits for a single animation frame (this performs a reflow) | `class="my-animation ng-animate super-add"` |
* | 5. the `.super` and `.super-add-active` classes are added (this triggers the CSS transition/animation) | `class="my-animation ng-animate super super-add super-add-active"` |
* | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay | `class="my-animation ng-animate super super-add super-add-active"` |
* | 7. `$animate` waits for the animation to complete (via events and timeout) | `class="my-animation ng-animate super super-add super-add-active"` |
* | 8. The animation ends and all generated CSS classes are removed from the element | `class="my-animation super"` |
* | 9. The super class is kept on the element | `class="my-animation super"` |
* | 10. The returned promise is resolved. | `class="my-animation super"` |
*
* @param {DOMElement} element the element that will be animated
* @param {string} className the CSS class that will be added to the element and then animated
@ -1096,17 +1097,17 @@ angular.module('ngAnimate', ['ng'])
*
* Below is a breakdown of each step that occurs during removeClass animation:
*
* | Animation Step | What the element class attribute looks like |
* |------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------|
* | 1. $animate.removeClass(element, 'super') is called | class="my-animation super" |
* | 2. $animate runs the JavaScript-defined animations detected on the element | class="my-animation super ng-animate" |
* | 3. the .super-remove class is added to the element | class="my-animation super ng-animate super-remove" |
* | 4. $animate waits for a single animation frame (this performs a reflow) | class="my-animation super ng-animate super-remove" |
* | 5. the .super-remove-active classes are added and .super is removed (this triggers the CSS transition/animation) | class="my-animation ng-animate super-remove super-remove-active" |
* | 6. $animate scans the element styles to get the CSS transition/animation duration and delay | class="my-animation super ng-animate super-remove" |
* | 7. $animate waits for the animation to complete (via events and timeout) | class="my-animation ng-animate super-remove super-remove-active" |
* | 8. The animation ends and all generated CSS classes are removed from the element | class="my-animation" |
* | 9. The returned promise is resolved. | class="my-animation" |
* | Animation Step | What the element class attribute looks like |
* |----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|
* | 1. `$animate.removeClass(element, 'super')` is called | `class="my-animation super"` |
* | 2. `$animate` runs the JavaScript-defined animations detected on the element | `class="my-animation super ng-animate"` |
* | 3. the `.super-remove` class is added to the element | `class="my-animation super ng-animate super-remove"` |
* | 4. `$animate` waits for a single animation frame (this performs a reflow) | `class="my-animation super ng-animate super-remove"` |
* | 5. the `.super-remove-active` classes are added and `.super` is removed (this triggers the CSS transition/animation) | `class="my-animation ng-animate super-remove super-remove-active"` |
* | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay | `class="my-animation ng-animate super-remove super-remove-active"` |
* | 7. `$animate` waits for the animation to complete (via events and timeout) | `class="my-animation ng-animate super-remove super-remove-active"` |
* | 8. The animation ends and all generated CSS classes are removed from the element | `class="my-animation"` |
* | 9. The returned promise is resolved. | `class="my-animation"` |
*
*
* @param {DOMElement} element the element that will be animated
@ -1124,19 +1125,19 @@ angular.module('ngAnimate', ['ng'])
* @name $animate#setClass
*
* @description Adds and/or removes the given CSS classes to and from the element.
* Once complete, the done() callback will be fired (if provided).
* Once complete, the `done()` callback will be fired (if provided).
*
* | Animation Step | What the element class attribute looks like |
* |--------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
* | 1. $animate.removeClass(element, on, off) is called | class="my-animation super off |
* | 2. $animate runs the JavaScript-defined animations detected on the element | class="my-animation super ng-animate off |
* | 3. the .on-add and .off-remove classes are added to the element | class="my-animation ng-animate on-add off-remove off |
* | 4. $animate waits for a single animation frame (this performs a reflow) | class="my-animation ng-animate on-add off-remove off |
* | 5. the .on, .on-add-active and .off-remove-active classes are added and .off is removed (this triggers the CSS transition/animation) | class="my-animation ng-animate on on-add on-add-active off-remove off-remove-active |
* | 6. $animate scans the element styles to get the CSS transition/animation duration and delay | class="my-animation ng-animate on on-add on-add-active off-remove off-remove-active" |
* | 7. $animate waits for the animation to complete (via events and timeout) | class="my-animation ng-animate on on-add on-add-active off-remove off-remove-active" |
* | 8. The animation ends and all generated CSS classes are removed from the element | class="my-animation on" |
* | 9. The returned promise is resolved. | class="my-animation on" |
* | Animation Step | What the element class attribute looks like |
* |----------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|
* | 1. `$animate.setClass(element, 'on', 'off')` is called | `class="my-animation off"` |
* | 2. `$animate` runs the JavaScript-defined animations detected on the element | `class="my-animation ng-animate off"` |
* | 3. the `.on-add` and `.off-remove` classes are added to the element | `class="my-animation ng-animate on-add off-remove off"` |
* | 4. `$animate` waits for a single animation frame (this performs a reflow) | `class="my-animation ng-animate on-add off-remove off"` |
* | 5. the `.on`, `.on-add-active` and `.off-remove-active` classes are added and `.off` is removed (this triggers the CSS transition/animation) | `class="my-animation ng-animate on on-add on-add-active off-remove off-remove-active"` |
* | 6. `$animate` scans the element styles to get the CSS transition/animation duration and delay | `class="my-animation ng-animate on on-add on-add-active off-remove off-remove-active"` |
* | 7. `$animate` waits for the animation to complete (via events and timeout) | `class="my-animation ng-animate on on-add on-add-active off-remove off-remove-active"` |
* | 8. The animation ends and all generated CSS classes are removed from the element | `class="my-animation on"` |
* | 9. The returned promise is resolved. | `class="my-animation on"` |
*
* @param {DOMElement} element the element which will have its CSS classes changed
* removed from it
@ -1274,7 +1275,7 @@ angular.module('ngAnimate', ['ng'])
all animations call this shared animation triggering function internally.
The animationEvent variable refers to the JavaScript animation event that will be triggered
and the className value is the name of the animation that will be applied within the
CSS code. Element, parentElement and afterElement are provided DOM elements for the animation
CSS code. Element, `parentElement` and `afterElement` are provided DOM elements for the animation
and the onComplete callback will be fired once the animation is fully complete.
*/
function performAnimation(animationEvent, className, element, parentElement, afterElement, domOperation, options, doneCallback) {
@ -1386,10 +1387,10 @@ angular.module('ngAnimate', ['ng'])
//the ng-animate class does nothing, but it's here to allow for
//parent animations to find and cancel child animations when needed
element.addClass(NG_ANIMATE_CLASS_NAME);
$$jqLite.addClass(element, NG_ANIMATE_CLASS_NAME);
if (options && options.tempClasses) {
forEach(options.tempClasses, function(className) {
element.addClass(className);
$$jqLite.addClass(element, className);
});
}
@ -1467,7 +1468,7 @@ angular.module('ngAnimate', ['ng'])
closeAnimation.hasBeenRun = true;
if (options && options.tempClasses) {
forEach(options.tempClasses, function(className) {
element.removeClass(className);
$$jqLite.removeClass(element, className);
});
}
@ -1529,7 +1530,7 @@ angular.module('ngAnimate', ['ng'])
}
if (removeAnimations || !data.totalActive) {
element.removeClass(NG_ANIMATE_CLASS_NAME);
$$jqLite.removeClass(element, NG_ANIMATE_CLASS_NAME);
element.removeData(NG_ANIMATE_STATE);
}
}
@ -1770,14 +1771,14 @@ angular.module('ngAnimate', ['ng'])
var staggerCacheKey = cacheKey + ' ' + staggerClassName;
var applyClasses = !lookupCache[staggerCacheKey];
applyClasses && element.addClass(staggerClassName);
applyClasses && $$jqLite.addClass(element, staggerClassName);
stagger = getElementAnimationDetails(element, staggerCacheKey);
applyClasses && element.removeClass(staggerClassName);
applyClasses && $$jqLite.removeClass(element, staggerClassName);
}
element.addClass(className);
$$jqLite.addClass(element, className);
var formerData = element.data(NG_ANIMATE_CSS_DATA_KEY) || {};
var timings = getElementAnimationDetails(element, eventCacheKey);
@ -1785,7 +1786,7 @@ angular.module('ngAnimate', ['ng'])
var animationDuration = timings.animationDuration;
if (structural && transitionDuration === 0 && animationDuration === 0) {
element.removeClass(className);
$$jqLite.removeClass(element, className);
return false;
}
@ -1857,7 +1858,7 @@ angular.module('ngAnimate', ['ng'])
}
if (!staggerTime) {
element.addClass(activeClassName);
$$jqLite.addClass(element, activeClassName);
if (elementData.blockTransition) {
blockTransitions(node, false);
}
@ -1867,7 +1868,7 @@ angular.module('ngAnimate', ['ng'])
var timings = getElementAnimationDetails(element, eventCacheKey);
var maxDuration = Math.max(timings.transitionDuration, timings.animationDuration);
if (maxDuration === 0) {
element.removeClass(activeClassName);
$$jqLite.removeClass(element, activeClassName);
animateClose(element, className);
activeAnimationComplete();
return;
@ -1889,7 +1890,7 @@ angular.module('ngAnimate', ['ng'])
//the jqLite object, so we're safe to use a single variable to house
//the styles since there is always only one element being animated
var oldStyle = node.getAttribute('style') || '';
if (oldStyle.charAt(oldStyle.length-1) !== ';') {
if (oldStyle.charAt(oldStyle.length - 1) !== ';') {
oldStyle += ';';
}
node.setAttribute('style', oldStyle + ' ' + style);
@ -1902,7 +1903,7 @@ angular.module('ngAnimate', ['ng'])
var staggerTimeout;
if (staggerTime > 0) {
element.addClass(pendingClassName);
$$jqLite.addClass(element, pendingClassName);
staggerTimeout = $timeout(function() {
staggerTimeout = null;
@ -1913,8 +1914,8 @@ angular.module('ngAnimate', ['ng'])
blockAnimations(node, false);
}
element.addClass(activeClassName);
element.removeClass(pendingClassName);
$$jqLite.addClass(element, activeClassName);
$$jqLite.removeClass(element, pendingClassName);
if (styles) {
if (timings.transitionDuration === 0) {
@ -1941,8 +1942,8 @@ angular.module('ngAnimate', ['ng'])
// timeout done method.
function onEnd() {
element.off(css3AnimationEvents, onAnimationProgress);
element.removeClass(activeClassName);
element.removeClass(pendingClassName);
$$jqLite.removeClass(element, activeClassName);
$$jqLite.removeClass(element, pendingClassName);
if (staggerTimeout) {
$timeout.cancel(staggerTimeout);
}
@ -2030,7 +2031,7 @@ angular.module('ngAnimate', ['ng'])
}
function animateClose(element, className) {
element.removeClass(className);
$$jqLite.removeClass(element, className);
var data = element.data(NG_ANIMATE_CSS_DATA_KEY);
if (data) {
if (data.running) {

View File

@ -1,5 +1,5 @@
/**
* @license AngularJS v1.3.2
* @license AngularJS v1.3.7
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
@ -117,7 +117,7 @@ angular.mock.$Browser = function() {
self.defer.now += delay;
} else {
if (self.deferredFns.length) {
self.defer.now = self.deferredFns[self.deferredFns.length-1].time;
self.defer.now = self.deferredFns[self.deferredFns.length - 1].time;
} else {
throw new Error('No deferred tasks to be flushed');
}
@ -428,7 +428,7 @@ angular.mock.$LogProvider = function() {
});
});
if (errors.length) {
errors.unshift("Expected $log to be empty! Either a message was logged unexpectedly, or "+
errors.unshift("Expected $log to be empty! Either a message was logged unexpectedly, or " +
"an expected log message was not checked and removed:");
errors.push('');
throw new Error(errors.join('\n---------\n'));
@ -461,17 +461,17 @@ angular.mock.$LogProvider = function() {
* @returns {promise} A promise which will be notified on each iteration.
*/
angular.mock.$IntervalProvider = function() {
this.$get = ['$rootScope', '$q',
function($rootScope, $q) {
this.$get = ['$browser', '$rootScope', '$q', '$$q',
function($browser, $rootScope, $q, $$q) {
var repeatFns = [],
nextRepeatId = 0,
now = 0;
var $interval = function(fn, delay, count, invokeApply) {
var deferred = $q.defer(),
promise = deferred.promise,
iteration = 0,
skipApply = (angular.isDefined(invokeApply) && !invokeApply);
var iteration = 0,
skipApply = (angular.isDefined(invokeApply) && !invokeApply),
deferred = (skipApply ? $$q : $q).defer(),
promise = deferred.promise;
count = (angular.isDefined(count)) ? count : 0;
promise.then(null, null, fn);
@ -494,7 +494,11 @@ angular.mock.$IntervalProvider = function() {
}
}
if (!skipApply) $rootScope.$apply();
if (skipApply) {
$browser.defer.flush();
} else {
$rootScope.$apply();
}
}
repeatFns.push({
@ -581,10 +585,10 @@ function jsonStringToDate(string) {
tzMin = int(match[9] + match[11]);
}
date.setUTCFullYear(int(match[1]), int(match[2]) - 1, int(match[3]));
date.setUTCHours(int(match[4]||0) - tzHour,
int(match[5]||0) - tzMin,
int(match[6]||0),
int(match[7]||0));
date.setUTCHours(int(match[4] || 0) - tzHour,
int(match[5] || 0) - tzMin,
int(match[6] || 0),
int(match[7] || 0));
return date;
}
return string;
@ -663,7 +667,7 @@ angular.mock.TzDate = function(offset, timestamp) {
}
var localOffset = new Date(timestamp).getTimezoneOffset();
self.offsetDiff = localOffset*60*1000 - offset*1000*60*60;
self.offsetDiff = localOffset * 60 * 1000 - offset * 1000 * 60 * 60;
self.date = new Date(timestamp + self.offsetDiff);
self.getTime = function() {
@ -815,7 +819,7 @@ angular.mock.animate = angular.module('ngAnimateMock', ['ng'])
animate.queue.push({
event: method,
element: arguments[0],
options: arguments[arguments.length-1],
options: arguments[arguments.length - 1],
args: arguments
});
return $delegate[method].apply($delegate, arguments);
@ -1115,7 +1119,7 @@ angular.mock.dump = function(object) {
```
*/
angular.mock.$HttpBackendProvider = function() {
this.$get = ['$rootScope', createHttpBackendMock];
this.$get = ['$rootScope', '$timeout', createHttpBackendMock];
};
/**
@ -1132,7 +1136,7 @@ angular.mock.$HttpBackendProvider = function() {
* @param {Object=} $browser Auto-flushing enabled if specified
* @return {Object} Instance of $httpBackend mock
*/
function createHttpBackendMock($rootScope, $delegate, $browser) {
function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
var definitions = [],
expectations = [],
responses = [],
@ -1145,7 +1149,7 @@ function createHttpBackendMock($rootScope, $delegate, $browser) {
return function() {
return angular.isNumber(status)
? [status, data, headers, statusText]
: [200, status, data];
: [200, status, data, headers];
};
}
@ -1162,7 +1166,9 @@ function createHttpBackendMock($rootScope, $delegate, $browser) {
}
function wrapResponse(wrapped) {
if (!$browser && timeout && timeout.then) timeout.then(handleTimeout);
if (!$browser && timeout) {
timeout.then ? timeout.then(handleTimeout) : $timeout(handleTimeout, timeout);
}
return handleResponse;
@ -1770,7 +1776,7 @@ angular.mock.$RAFDecorator = ['$delegate', function($delegate) {
}
var length = queue.length;
for (var i=0;i<length;i++) {
for (var i = 0; i < length; i++) {
queue[i]();
}
@ -2036,7 +2042,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
*/
angular.mock.e2e = {};
angular.mock.e2e.$httpBackendDecorator =
['$rootScope', '$delegate', '$browser', createHttpBackendMock];
['$rootScope', '$timeout', '$delegate', '$browser', createHttpBackendMock];
/**
@ -2050,7 +2056,7 @@ angular.mock.e2e.$httpBackendDecorator =
*
* In addition to all the regular `Scope` methods, the following helper methods are available:
*/
angular.mock.$RootScopeDecorator = function($delegate) {
angular.mock.$RootScopeDecorator = ['$delegate', function($delegate) {
var $rootScopePrototype = Object.getPrototypeOf($delegate);
@ -2122,7 +2128,7 @@ angular.mock.$RootScopeDecorator = function($delegate) {
return count;
}
};
}];
if (window.jasmine || window.mocha) {

View File

@ -1,5 +1,5 @@
/**
* @license AngularJS v1.3.2
* @license AngularJS v1.3.7
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
@ -41,7 +41,7 @@ var ngRouteModule = angular.module('ngRoute', ['ng']).
*/
function $RouteProvider() {
function inherit(parent, extra) {
return angular.extend(new (angular.extend(function() {}, {prototype:parent}))(), extra);
return angular.extend(Object.create(parent), extra);
}
var routes = {};
@ -151,6 +151,9 @@ function $RouteProvider() {
if (angular.isUndefined(routeCopy.reloadOnSearch)) {
routeCopy.reloadOnSearch = true;
}
if (angular.isUndefined(routeCopy.caseInsensitiveMatch)) {
routeCopy.caseInsensitiveMatch = this.caseInsensitiveMatch;
}
routes[path] = angular.extend(
routeCopy,
path && pathRegExp(path, routeCopy)
@ -158,9 +161,9 @@ function $RouteProvider() {
// create redirection for trailing slashes
if (path) {
var redirectPath = (path[path.length-1] == '/')
? path.substr(0, path.length-1)
: path +'/';
var redirectPath = (path[path.length - 1] == '/')
? path.substr(0, path.length - 1)
: path + '/';
routes[redirectPath] = angular.extend(
{redirectTo: path},
@ -171,6 +174,17 @@ function $RouteProvider() {
return this;
};
/**
* @ngdoc property
* @name $routeProvider#caseInsensitiveMatch
* @description
*
* A boolean property indicating if routes defined
* using this provider should be matched using a case insensitive
* algorithm. Defaults to `false`.
*/
this.caseInsensitiveMatch = false;
/**
* @param path {string} path
* @param opts {Object} options
@ -639,11 +653,11 @@ function $RouteProvider() {
*/
function interpolate(string, params) {
var result = [];
angular.forEach((string||'').split(':'), function(segment, i) {
angular.forEach((string || '').split(':'), function(segment, i) {
if (i === 0) {
result.push(segment);
} else {
var segmentMatch = segment.match(/(\w+)(.*)/);
var segmentMatch = segment.match(/(\w+)(?:[?*])?(.*)/);
var key = segmentMatch[1];
result.push(params[key]);
result.push(segmentMatch[2] || '');
@ -774,7 +788,6 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
.view-animate-container {
position:relative;
height:100px!important;
position:relative;
background:white;
border:1px solid black;
height:40px;

File diff suppressed because it is too large Load Diff