MCPcopy
hub / github.com/Splidejs/splide / move

Function move

src/js/components/Move/Move.ts:91–105  ·  view source on GitHub ↗

* Moves the slider to the dest index with the Transition component. * * @param dest - A destination index to go to, including clones'. * @param index - A slide index. * @param prev - A previous index. * @param callback - Optional. A callback function invoked after transitio

( dest: number, index: number, prev: number, callback?: AnyFunction )

Source from the content-addressed store, hash-verified

89 * @param callback - Optional. A callback function invoked after transition ends.
90 */
91 function move( dest: number, index: number, prev: number, callback?: AnyFunction ): void {
92 if ( dest !== index && canShift( dest > prev ) ) {
93 cancel();
94 translate( shift( getPosition(), dest > prev ), true );
95 }
96
97 set( MOVING );
98 emit( EVENT_MOVE, index, prev, dest );
99
100 Transition.start( index, () => {
101 set( IDLE );
102 emit( EVENT_MOVED, index, prev, dest );
103 callback && callback();
104 } );
105 }
106
107 /**
108 * Jumps to the slide at the specified index.

Callers

nothing calls this directly

Calls 8

canShiftFunction · 0.85
translateFunction · 0.85
shiftFunction · 0.85
getPositionFunction · 0.85
cancelFunction · 0.70
startMethod · 0.65
setFunction · 0.50
emitFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…