MCPcopy Index your code
hub / github.com/SortableJS/Sortable / captureAnimationState

Function captureAnimationState

src/Animation.js:9–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7
8 return {
9 captureAnimationState() {
10 animationStates = [];
11 if (!this.options.animation) return;
12 let children = [].slice.call(this.el.children);
13
14 children.forEach(child => {
15 if (css(child, 'display') === 'none' || child === Sortable.ghost) return;
16 animationStates.push({
17 target: child,
18 rect: getRect(child)
19 });
20 let fromRect = { ...animationStates[animationStates.length - 1].rect };
21
22 // If animating: compensate for current animation
23 if (child.thisAnimationDuration) {
24 let childMatrix = matrix(child, true);
25 if (childMatrix) {
26 fromRect.top -= childMatrix.f;
27 fromRect.left -= childMatrix.e;
28 }
29 }
30
31 child.fromRect = fromRect;
32 });
33 },
34
35 addAnimationState(state) {
36 animationStates.push(state);

Callers

nothing calls this directly

Calls 3

cssFunction · 0.90
getRectFunction · 0.90
matrixFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…