MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / onDisplaying

Method onDisplaying

examples/piu/timeline/main.js:74–84  ·  view source on GitHub ↗
(container)

Source from the content-addressed store, hash-verified

72
73class OnBehavior extends TimelineBehavior {
74 onDisplaying(container) {
75 let timeline = this.timeline = new Timeline();
76 let one=container.first, two=one.next, three=two.next, four=container.last, size=one.width, startX = one.x+64, startY = one.y+64;
77 one.state = 0; two.state = 1; three.state = 2; four.state = 3;
78 let l=container.x, r=container.x+container.width-size, t=container.y, b=container.y+container.height-size;
79 timeline.on(one, { x: [startX, l, r, r, l], y: [startY, t, t, b, b] }, 2000, null, 0);
80 timeline.on(two, { x: [startX, l, l, r, r], y: [startY, b, t, t, b] }, 2000, null, -2000);
81 timeline.on(three, { x: [startX, r, l, l, r], y: [startY, b, b, t, t] }, 2000, null, -2000);
82 timeline.on(four, { x: [startX, r, r, l, l], y: [startY, t, b, b, t] }, 2000, null, -2000);
83 super.startTimeline(container);
84 }
85}
86
87const TimelineContainer = Container.template($ => ({

Callers

nothing calls this directly

Calls 2

startTimelineMethod · 0.80
onMethod · 0.45

Tested by

no test coverage detected