MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / animateToShallow

Function animateToShallow

libs/echarts/echarts.simple.js:4998–5039  ·  view source on GitHub ↗

* @param {string} path='' * @param {Object} source=animatable * @param {Object} target * @param {number} [time=500] * @param {number} [delay=0] * @param {boolean} [reverse] If `true`, animate * from the `target` to current state. * * @example * // Animate position * el._animateToS

(animatable, path, source, target, time, delay, reverse)

Source from the content-addressed store, hash-verified

4996 * }, 100, 100)
4997 */
4998function animateToShallow(animatable, path, source, target, time, delay, reverse) {
4999 var objShallow = {};
5000 var propertyCount = 0;
5001 for (var name in target) {
5002 if (!target.hasOwnProperty(name)) {
5003 continue;
5004 }
5005
5006 if (source[name] != null) {
5007 if (isObject$1(target[name]) && !isArrayLike(target[name])) {
5008 animateToShallow(
5009 animatable,
5010 path ? path + '.' + name : name,
5011 source[name],
5012 target[name],
5013 time,
5014 delay,
5015 reverse
5016 );
5017 }
5018 else {
5019 if (reverse) {
5020 objShallow[name] = source[name];
5021 setAttrByPath(animatable, path, name, target[name]);
5022 }
5023 else {
5024 objShallow[name] = target[name];
5025 }
5026 propertyCount++;
5027 }
5028 }
5029 else if (target[name] != null && !reverse) {
5030 setAttrByPath(animatable, path, name, target[name]);
5031 }
5032 }
5033
5034 if (propertyCount > 0) {
5035 animatable.animate(path, false)
5036 .when(time == null ? 500 : time, objShallow)
5037 .delay(delay || 0);
5038 }
5039}
5040
5041function setAttrByPath(el, path, name, value) {
5042 // Attr directly if not has property

Callers 1

animateToFunction · 0.70

Calls 6

delayMethod · 0.80
whenMethod · 0.80
isObject$1Function · 0.70
isArrayLikeFunction · 0.70
setAttrByPathFunction · 0.70
animateMethod · 0.45

Tested by

no test coverage detected