* 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 )
| 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. |
nothing calls this directly
no test coverage detected
searching dependent graphs…