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

Function canShift

src/js/components/Move/Move.ts:266–271  ·  view source on GitHub ↗

* Checks if there is enough width to shift the slider. * * @param backwards - `true` for checking backwards, or `false` for doing forwards. * * @return `true` if the slider can be shifted for the specified direction, or otherwise `false`.

( backwards: boolean )

Source from the content-addressed store, hash-verified

264 * @return `true` if the slider can be shifted for the specified direction, or otherwise `false`.
265 */
266 function canShift( backwards: boolean ): boolean {
267 const shifted = orient( shift( getPosition(), backwards ) );
268 return backwards
269 ? shifted >= 0
270 : shifted <= list[ resolve( 'scrollWidth' ) ] - rect( track )[ resolve( 'width' ) ];
271 }
272
273 /**
274 * Checks if the provided position exceeds the minimum or maximum limit or not.

Callers 1

moveFunction · 0.85

Calls 5

rectFunction · 0.90
orientFunction · 0.85
shiftFunction · 0.85
getPositionFunction · 0.85
resolveFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…