Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Commit b89622b

Browse files
committed
v1.5.0-build.4279+sha.9f67da6
1 parent 7e7165b commit b89622b

35 files changed

+194
-137
lines changed

snapshot/angular-animate.js

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.5.0-build.4278+sha.b3a3c6a
2+
* @license AngularJS v1.5.0-build.4279+sha.9f67da6
33
* (c) 2010-2015 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/
@@ -640,6 +640,10 @@ var ANIMATE_TIMER_KEY = '$$animateCss';
640640
* * `staggerIndex` - The numeric index representing the stagger item (e.g. a value of 5 is equal to the sixth item in the stagger; therefore when a
641641
* * `stagger` option value of `0.1` is used then there will be a stagger delay of `600ms`)
642642
* * `applyClassesEarly` - Whether or not the classes being added or removed will be used when detecting the animation. This is set by `$animate` when enter/leave/move animations are fired to ensure that the CSS classes are resolved in time. (Note that this will prevent any transitions from occuring on the classes being added and removed.)
643+
* * `cleanupStyles` - Whether or not the provided `from` and `to` styles will be removed once
644+
* the animation is closed. This is useful for when the styles are used purely for the sake of
645+
* the animation and do not have a lasting visual effect on the element (e.g. a colapse and open animation).
646+
* By default this value is set to `false`.
643647
*
644648
* @return {object} an object with start and end methods and details about the animation.
645649
*
@@ -760,6 +764,23 @@ function createLocalCacheLookup() {
760764
};
761765
}
762766

767+
// we do not reassign an already present style value since
768+
// if we detect the style property value again we may be
769+
// detecting styles that were added via the `from` styles.
770+
// We make use of `isDefined` here since an empty string
771+
// or null value (which is what getPropertyValue will return
772+
// for a non-existing style) will still be marked as a valid
773+
// value for the style (a falsy value implies that the style
774+
// is to be removed at the end of the animation). If we had a simple
775+
// "OR" statement then it would not be enough to catch that.
776+
function registerRestorableStyles(backup, node, properties) {
777+
forEach(properties, function(prop) {
778+
backup[prop] = isDefined(backup[prop])
779+
? backup[prop]
780+
: node.style.getPropertyValue(prop);
781+
});
782+
}
783+
763784
var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
764785
var gcsLookup = createLocalCacheLookup();
765786
var gcsStaggerLookup = createLocalCacheLookup();
@@ -860,6 +881,7 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
860881
}
861882

862883
return function init(element, options) {
884+
var restoreStyles = {};
863885
var node = getDomNode(element);
864886
if (!node
865887
|| !node.parentNode
@@ -1061,7 +1083,12 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
10611083
stagger.animationDuration === 0;
10621084
}
10631085

1064-
applyAnimationFromStyles(element, options);
1086+
if (options.from) {
1087+
if (options.cleanupStyles) {
1088+
registerRestorableStyles(restoreStyles, node, Object.keys(options.from));
1089+
}
1090+
applyAnimationFromStyles(element, options);
1091+
}
10651092

10661093
if (flags.blockTransition || flags.blockKeyframeAnimation) {
10671094
applyBlocking(maxDuration);
@@ -1128,6 +1155,13 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
11281155
applyAnimationClasses(element, options);
11291156
applyAnimationStyles(element, options);
11301157

1158+
if (Object.keys(restoreStyles).length) {
1159+
forEach(restoreStyles, function(value, prop) {
1160+
value ? node.style.setProperty(prop, value)
1161+
: node.style.removeProperty(prop);
1162+
});
1163+
}
1164+
11311165
// the reason why we have this option is to allow a synchronous closing callback
11321166
// that is fired as SOON as the animation ends (when the CSS is removed) or if
11331167
// the animation never takes off at all. A good example is a leave animation since
@@ -1322,7 +1356,12 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
13221356
}
13231357

13241358
element.on(events.join(' '), onAnimationProgress);
1325-
applyAnimationToStyles(element, options);
1359+
if (options.to) {
1360+
if (options.cleanupStyles) {
1361+
registerRestorableStyles(restoreStyles, node, Object.keys(options.to));
1362+
}
1363+
applyAnimationToStyles(element, options);
1364+
}
13261365
}
13271366

13281367
function onAnimationExpired() {

snapshot/angular-animate.min.js

Lines changed: 51 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

snapshot/angular-animate.min.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

snapshot/angular-aria.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.5.0-build.4278+sha.b3a3c6a
2+
* @license AngularJS v1.5.0-build.4279+sha.9f67da6
33
* (c) 2010-2015 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/

snapshot/angular-aria.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

snapshot/angular-cookies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.5.0-build.4278+sha.b3a3c6a
2+
* @license AngularJS v1.5.0-build.4279+sha.9f67da6
33
* (c) 2010-2015 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/

snapshot/angular-cookies.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

snapshot/angular-loader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.5.0-build.4278+sha.b3a3c6a
2+
* @license AngularJS v1.5.0-build.4279+sha.9f67da6
33
* (c) 2010-2015 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/
@@ -59,7 +59,7 @@ function minErr(module, ErrorConstructor) {
5959
return match;
6060
});
6161

62-
message += '\nhttp://errors.angularjs.org/1.5.0-build.4278+sha.b3a3c6a/' +
62+
message += '\nhttp://errors.angularjs.org/1.5.0-build.4279+sha.9f67da6/' +
6363
(module ? module + '/' : '') + code;
6464

6565
for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {

snapshot/angular-loader.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)