mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-29 23:25:27 +00:00
(js/css) Update generated files
This commit is contained in:
+181
-44
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @license AngularJS v1.4.9
|
||||
* @license AngularJS v1.4.10
|
||||
* (c) 2010-2015 Google, Inc. http://angularjs.org
|
||||
* License: MIT
|
||||
*/
|
||||
@@ -26,6 +26,7 @@ var ADD_CLASS_SUFFIX = '-add';
|
||||
var REMOVE_CLASS_SUFFIX = '-remove';
|
||||
var EVENT_CLASS_PREFIX = 'ng-';
|
||||
var ACTIVE_CLASS_SUFFIX = '-active';
|
||||
var PREPARE_CLASS_SUFFIX = '-prepare';
|
||||
|
||||
var NG_ANIMATE_CLASSNAME = 'ng-animate';
|
||||
var NG_ANIMATE_CHILDREN_DATA = '$$ngAnimateChildren';
|
||||
@@ -222,7 +223,10 @@ function applyAnimationToStyles(element, options) {
|
||||
}
|
||||
}
|
||||
|
||||
function mergeAnimationOptions(element, target, newOptions) {
|
||||
function mergeAnimationDetails(element, oldAnimation, newAnimation) {
|
||||
var target = oldAnimation.options || {};
|
||||
var newOptions = newAnimation.options || {};
|
||||
|
||||
var toAdd = (target.addClass || '') + ' ' + (newOptions.addClass || '');
|
||||
var toRemove = (target.removeClass || '') + ' ' + (newOptions.removeClass || '');
|
||||
var classes = resolveElementClasses(element.attr('class'), toAdd, toRemove);
|
||||
@@ -254,6 +258,9 @@ function mergeAnimationOptions(element, target, newOptions) {
|
||||
target.removeClass = null;
|
||||
}
|
||||
|
||||
oldAnimation.addClass = target.addClass;
|
||||
oldAnimation.removeClass = target.removeClass;
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
@@ -424,16 +431,101 @@ var $$rAFSchedulerFactory = ['$$rAF', function($$rAF) {
|
||||
}
|
||||
}];
|
||||
|
||||
var $$AnimateChildrenDirective = [function() {
|
||||
return function(scope, element, attrs) {
|
||||
var val = attrs.ngAnimateChildren;
|
||||
if (angular.isString(val) && val.length === 0) { //empty attribute
|
||||
element.data(NG_ANIMATE_CHILDREN_DATA, true);
|
||||
} else {
|
||||
attrs.$observe('ngAnimateChildren', function(value) {
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @name ngAnimateChildren
|
||||
* @restrict AE
|
||||
* @element ANY
|
||||
*
|
||||
* @description
|
||||
*
|
||||
* ngAnimateChildren allows you to specify that children of this element should animate even if any
|
||||
* 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).
|
||||
*
|
||||
*
|
||||
* @param {string} ngAnimateChildren If the value is empty, `true` or `on`,
|
||||
* then child animations are allowed. If the value is `false`, child animations are not allowed.
|
||||
*
|
||||
* @example
|
||||
* <example module="ngAnimateChildren" name="ngAnimateChildren" deps="angular-animate.js" animations="true">
|
||||
<file name="index.html">
|
||||
<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>
|
||||
<div ng-animate-children="{{main.animateChildren}}">
|
||||
<div ng-if="main.enterElement" class="container">
|
||||
List of items:
|
||||
<div ng-repeat="item in [0, 1, 2, 3]" class="item">Item {{item}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</file>
|
||||
<file name="animations.css">
|
||||
|
||||
.container.ng-enter,
|
||||
.container.ng-leave {
|
||||
transition: all ease 1.5s;
|
||||
}
|
||||
|
||||
.container.ng-enter,
|
||||
.container.ng-leave-active {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.container.ng-leave,
|
||||
.container.ng-enter-active {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.item {
|
||||
background: firebrick;
|
||||
color: #FFF;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.item.ng-enter,
|
||||
.item.ng-leave {
|
||||
transition: transform 1.5s ease;
|
||||
}
|
||||
|
||||
.item.ng-enter {
|
||||
transform: translateX(50px);
|
||||
}
|
||||
|
||||
.item.ng-enter-active {
|
||||
transform: translateX(0);
|
||||
}
|
||||
</file>
|
||||
<file name="script.js">
|
||||
angular.module('ngAnimateChildren', ['ngAnimate'])
|
||||
.controller('mainController', function() {
|
||||
this.animateChildren = false;
|
||||
this.enterElement = false;
|
||||
});
|
||||
</file>
|
||||
</example>
|
||||
*/
|
||||
var $$AnimateChildrenDirective = ['$interpolate', function($interpolate) {
|
||||
return {
|
||||
link: function(scope, element, attrs) {
|
||||
var val = attrs.ngAnimateChildren;
|
||||
if (angular.isString(val) && val.length === 0) { //empty attribute
|
||||
element.data(NG_ANIMATE_CHILDREN_DATA, true);
|
||||
} else {
|
||||
// Interpolate and set the value, so that it is available to
|
||||
// animations that run right after compilation
|
||||
setData($interpolate(val)(scope));
|
||||
attrs.$observe('ngAnimateChildren', setData);
|
||||
}
|
||||
|
||||
function setData(value) {
|
||||
value = value === 'on' || value === 'true';
|
||||
element.data(NG_ANIMATE_CHILDREN_DATA, value);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}];
|
||||
@@ -1194,6 +1286,13 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
|
||||
element.off(events.join(' '), onAnimationProgress);
|
||||
}
|
||||
|
||||
//Cancel the fallback closing timeout and remove the timer data
|
||||
var animationTimerData = element.data(ANIMATE_TIMER_KEY);
|
||||
if (animationTimerData) {
|
||||
$timeout.cancel(animationTimerData[0].timer);
|
||||
element.removeData(ANIMATE_TIMER_KEY);
|
||||
}
|
||||
|
||||
// if the preparation function fails then the promise is not setup
|
||||
if (runner) {
|
||||
runner.complete(!rejected);
|
||||
@@ -2086,22 +2185,21 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
|
||||
});
|
||||
}
|
||||
|
||||
function hasAnimationClasses(options, and) {
|
||||
options = options || {};
|
||||
var a = (options.addClass || '').length > 0;
|
||||
var b = (options.removeClass || '').length > 0;
|
||||
function hasAnimationClasses(animation, and) {
|
||||
var a = (animation.addClass || '').length > 0;
|
||||
var b = (animation.removeClass || '').length > 0;
|
||||
return and ? a && b : a || b;
|
||||
}
|
||||
|
||||
rules.join.push(function(element, newAnimation, currentAnimation) {
|
||||
// if the new animation is class-based then we can just tack that on
|
||||
return !newAnimation.structural && hasAnimationClasses(newAnimation.options);
|
||||
return !newAnimation.structural && hasAnimationClasses(newAnimation);
|
||||
});
|
||||
|
||||
rules.skip.push(function(element, 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.options);
|
||||
return !newAnimation.structural && !hasAnimationClasses(newAnimation);
|
||||
});
|
||||
|
||||
rules.skip.push(function(element, newAnimation, currentAnimation) {
|
||||
@@ -2127,19 +2225,17 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
|
||||
});
|
||||
|
||||
rules.cancel.push(function(element, newAnimation, currentAnimation) {
|
||||
|
||||
|
||||
var nA = newAnimation.options.addClass;
|
||||
var nR = newAnimation.options.removeClass;
|
||||
var cA = currentAnimation.options.addClass;
|
||||
var cR = currentAnimation.options.removeClass;
|
||||
var nA = newAnimation.addClass;
|
||||
var nR = newAnimation.removeClass;
|
||||
var cA = currentAnimation.addClass;
|
||||
var cR = currentAnimation.removeClass;
|
||||
|
||||
// early detection to save the global CPU shortage :)
|
||||
if ((isUndefined(nA) && isUndefined(nR)) || (isUndefined(cA) && isUndefined(cR))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (hasMatchingClasses(nA, cR)) || (hasMatchingClasses(nR, cA));
|
||||
return hasMatchingClasses(nA, cR) || hasMatchingClasses(nR, cA);
|
||||
});
|
||||
|
||||
this.$get = ['$$rAF', '$rootScope', '$rootElement', '$document', '$$HashMap',
|
||||
@@ -2211,8 +2307,8 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
|
||||
|
||||
var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
|
||||
|
||||
function normalizeAnimationOptions(element, options) {
|
||||
return mergeAnimationOptions(element, options, {});
|
||||
function normalizeAnimationDetails(element, animation) {
|
||||
return mergeAnimationDetails(element, animation, {});
|
||||
}
|
||||
|
||||
// IE9-11 has no method "contains" in SVG element and in Node.prototype. Bug #10259.
|
||||
@@ -2406,6 +2502,8 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
|
||||
structural: isStructural,
|
||||
element: element,
|
||||
event: event,
|
||||
addClass: options.addClass,
|
||||
removeClass: options.removeClass,
|
||||
close: close,
|
||||
options: options,
|
||||
runner: runner
|
||||
@@ -2418,11 +2516,10 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
|
||||
close();
|
||||
return runner;
|
||||
} else {
|
||||
mergeAnimationOptions(element, existingAnimation.options, options);
|
||||
mergeAnimationDetails(element, existingAnimation, newAnimation);
|
||||
return existingAnimation.runner;
|
||||
}
|
||||
}
|
||||
|
||||
var cancelAnimationFlag = isAllowed('cancel', element, newAnimation, existingAnimation);
|
||||
if (cancelAnimationFlag) {
|
||||
if (existingAnimation.state === RUNNING_STATE) {
|
||||
@@ -2437,7 +2534,8 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
|
||||
existingAnimation.close();
|
||||
} else {
|
||||
// this will merge the new animation options into existing animation options
|
||||
mergeAnimationOptions(element, existingAnimation.options, newAnimation.options);
|
||||
mergeAnimationDetails(element, existingAnimation, newAnimation);
|
||||
|
||||
return existingAnimation.runner;
|
||||
}
|
||||
} else {
|
||||
@@ -2447,12 +2545,12 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
|
||||
var joinAnimationFlag = isAllowed('join', element, newAnimation, existingAnimation);
|
||||
if (joinAnimationFlag) {
|
||||
if (existingAnimation.state === RUNNING_STATE) {
|
||||
normalizeAnimationOptions(element, options);
|
||||
normalizeAnimationDetails(element, newAnimation);
|
||||
} else {
|
||||
applyGeneratedPreparationClasses(element, isStructural ? event : null, options);
|
||||
|
||||
event = newAnimation.event = existingAnimation.event;
|
||||
options = mergeAnimationOptions(element, existingAnimation.options, newAnimation.options);
|
||||
options = mergeAnimationDetails(element, existingAnimation, newAnimation);
|
||||
|
||||
//we return the same runner since only the option values of this animation will
|
||||
//be fed into the `existingAnimation`.
|
||||
@@ -2463,7 +2561,7 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
|
||||
} else {
|
||||
// normalization in this case means that it removes redundant CSS classes that
|
||||
// already exist (addClass) or do not exist (removeClass) on the element
|
||||
normalizeAnimationOptions(element, options);
|
||||
normalizeAnimationDetails(element, newAnimation);
|
||||
}
|
||||
|
||||
// when the options are merged and cleaned up we may end up not having to do
|
||||
@@ -2473,7 +2571,7 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
|
||||
if (!isValidAnimation) {
|
||||
// animate (from/to) can be quickly checked first, otherwise we check if any classes are present
|
||||
isValidAnimation = (newAnimation.event === 'animate' && Object.keys(newAnimation.options.to || {}).length > 0)
|
||||
|| hasAnimationClasses(newAnimation.options);
|
||||
|| hasAnimationClasses(newAnimation);
|
||||
}
|
||||
|
||||
if (!isValidAnimation) {
|
||||
@@ -2503,7 +2601,7 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
|
||||
var isValidAnimation = parentElement.length > 0
|
||||
&& (animationDetails.event === 'animate'
|
||||
|| animationDetails.structural
|
||||
|| hasAnimationClasses(animationDetails.options));
|
||||
|| hasAnimationClasses(animationDetails));
|
||||
|
||||
// this means that the previous animation was cancelled
|
||||
// even if the follow-up animation is the same event
|
||||
@@ -2535,7 +2633,7 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
|
||||
|
||||
// this combined multiple class to addClass / removeClass into a setClass event
|
||||
// so long as a structural event did not take over the animation
|
||||
event = !animationDetails.structural && hasAnimationClasses(animationDetails.options, true)
|
||||
event = !animationDetails.structural && hasAnimationClasses(animationDetails, true)
|
||||
? 'setClass'
|
||||
: animationDetails.event;
|
||||
|
||||
@@ -2630,30 +2728,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
|
||||
@@ -2668,7 +2767,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;
|
||||
}
|
||||
@@ -2691,15 +2790,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;
|
||||
@@ -2857,6 +2956,12 @@ var $$AnimationProvider = ['$animateProvider', function($animateProvider) {
|
||||
options.tempClasses = null;
|
||||
}
|
||||
|
||||
var prepareClassName;
|
||||
if (isStructural) {
|
||||
prepareClassName = 'ng-' + event + PREPARE_CLASS_SUFFIX;
|
||||
$$jqLite.addClass(element, prepareClassName);
|
||||
}
|
||||
|
||||
animationQueue.push({
|
||||
// this data is used by the postDigest code and passed into
|
||||
// the driver step function
|
||||
@@ -3079,6 +3184,10 @@ var $$AnimationProvider = ['$animateProvider', function($animateProvider) {
|
||||
if (tempClasses) {
|
||||
$$jqLite.addClass(element, tempClasses);
|
||||
}
|
||||
if (prepareClassName) {
|
||||
$$jqLite.removeClass(element, prepareClassName);
|
||||
prepareClassName = null;
|
||||
}
|
||||
}
|
||||
|
||||
function updateAnimationRunners(animation, newRunner) {
|
||||
@@ -3373,6 +3482,34 @@ var $$AnimationProvider = ['$animateProvider', function($animateProvider) {
|
||||
* the CSS class once an animation has completed.)
|
||||
*
|
||||
*
|
||||
* ### The `ng-[event]-prepare` class
|
||||
*
|
||||
* This is a special class that can be used to prevent unwanted flickering / flash of content before
|
||||
* the actual animation starts. The class is added as soon as an animation is initialized, but removed
|
||||
* before the actual animation starts (after waiting for a $digest).
|
||||
* It is also only added for *structural* animations (`enter`, `move`, and `leave`).
|
||||
*
|
||||
* In practice, flickering can appear when nesting elements with structural animations such as `ngIf`
|
||||
* into elements that have class-based animations such as `ngClass`.
|
||||
*
|
||||
* ```html
|
||||
* <div ng-class="{red: myProp}">
|
||||
* <div ng-class="{blue: myProp}">
|
||||
* <div class="message" ng-if="myProp"></div>
|
||||
* </div>
|
||||
* </div>
|
||||
* ```
|
||||
*
|
||||
* It is possible that during the `enter` animation, the `.message` div will be briefly visible before it starts animating.
|
||||
* In that case, you can add styles to the CSS that make sure the element stays hidden before the animation starts:
|
||||
*
|
||||
* ```css
|
||||
* .message.ng-enter-prepare {
|
||||
* opacity: 0;
|
||||
* }
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* ## JavaScript-based Animations
|
||||
*
|
||||
* ngAnimate also allows for animations to be consumed by JavaScript code. The approach is similar to CSS-based animations (where there is a shared
|
||||
|
||||
Reference in New Issue
Block a user