MCPcopy Create free account
hub / github.com/neomjs/neo / onMoveVideoButtonClick

Method onMoveVideoButtonClick

examples/videoMove/MainContainer.mjs:54–78  ·  view source on GitHub ↗

* * @param {Object} data

(data)

Source from the content-addressed store, hash-verified

52 * @param {Object} data
53 */
54 onMoveVideoButtonClick(data) {
55 let me = this,
56 container1 = me.getReference('container-1'),
57 container2 = me.getReference('container-2'),
58 videoWrapper = me.getReference('video-wrapper');
59
60 container1.silentVdomUpdate = true;
61 container2.silentVdomUpdate = true;
62
63 if (container2.items.length < 1) {
64 container2.add(container1.removeAt(0, false))
65 } else {
66 container1.add(container2.removeAt(0, false))
67 }
68
69 // include 2 level of children:
70 // level 1 => container-1, container-2
71 // level 2 => video element(s)
72 videoWrapper.updateDepth = 3;
73
74 videoWrapper.promiseUpdate().then(() => {
75 container1.silentVdomUpdate = false;
76 container2.silentVdomUpdate = false
77 })
78 }
79}
80
81export default Neo.setupClass(MainContainer);

Callers

nothing calls this directly

Calls 4

promiseUpdateMethod · 0.80
getReferenceMethod · 0.45
addMethod · 0.45
removeAtMethod · 0.45

Tested by

no test coverage detected