Naotoshi Fujita 2 vuotta sitten
vanhempi
commit
be6637f997

+ 1 - 1
dist/js/splide-renderer.min.js

@@ -1,6 +1,6 @@
 /*!
  * Splide.js
- * Version  : 4.0.15
+ * Version  : 4.0.16
  * License  : MIT
  * Copyright: 2022 Naotoshi Fujita
  */

+ 4 - 3
dist/js/splide.cjs.js

@@ -1,6 +1,6 @@
 /*!
  * Splide.js
- * Version  : 4.0.15
+ * Version  : 4.0.16
  * License  : MIT
  * Copyright: 2022 Naotoshi Fujita
  */
@@ -2018,6 +2018,7 @@ function Scroll(Splide2, Components2, options) {
       getLimit = Move.getLimit,
       exceededLimit = Move.exceededLimit,
       translate = Move.translate;
+  var isSlide = Splide2.is(SLIDE);
   var interval;
   var callback;
   var friction = 1;
@@ -2031,7 +2032,7 @@ function Scroll(Splide2, Components2, options) {
     var from = getPosition();
     clear();
 
-    if (snap) {
+    if (snap && (!isSlide || !exceededLimit())) {
       var size = Components2.Layout.sliderSize();
       var offset = sign(destination) * size * floor(abs(destination) / size) || 0;
       destination = Move.toPosition(Components2.Controller.toDest(destination % size)) + offset;
@@ -2059,7 +2060,7 @@ function Scroll(Splide2, Components2, options) {
     var diff = (target - position) * friction;
     translate(position + diff);
 
-    if (Splide2.is(SLIDE) && !noConstrain && exceededLimit()) {
+    if (isSlide && !noConstrain && exceededLimit()) {
       friction *= FRICTION_FACTOR;
 
       if (abs(diff) < BOUNCE_DIFF_THRESHOLD) {

+ 4 - 3
dist/js/splide.esm.js

@@ -4,7 +4,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
 
 /*!
  * Splide.js
- * Version  : 4.0.15
+ * Version  : 4.0.16
  * License  : MIT
  * Copyright: 2022 Naotoshi Fujita
  */
@@ -2013,6 +2013,7 @@ function Scroll(Splide2, Components2, options) {
       getLimit = Move.getLimit,
       exceededLimit = Move.exceededLimit,
       translate = Move.translate;
+  var isSlide = Splide2.is(SLIDE);
   var interval;
   var callback;
   var friction = 1;
@@ -2026,7 +2027,7 @@ function Scroll(Splide2, Components2, options) {
     var from = getPosition();
     clear();
 
-    if (snap) {
+    if (snap && (!isSlide || !exceededLimit())) {
       var size = Components2.Layout.sliderSize();
       var offset = sign(destination) * size * floor(abs(destination) / size) || 0;
       destination = Move.toPosition(Components2.Controller.toDest(destination % size)) + offset;
@@ -2054,7 +2055,7 @@ function Scroll(Splide2, Components2, options) {
     var diff = (target - position) * friction;
     translate(position + diff);
 
-    if (Splide2.is(SLIDE) && !noConstrain && exceededLimit()) {
+    if (isSlide && !noConstrain && exceededLimit()) {
       friction *= FRICTION_FACTOR;
 
       if (abs(diff) < BOUNCE_DIFF_THRESHOLD) {

+ 4 - 3
dist/js/splide.js

@@ -4,7 +4,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
 
 /*!
  * Splide.js
- * Version  : 4.0.15
+ * Version  : 4.0.16
  * License  : MIT
  * Copyright: 2022 Naotoshi Fujita
  */
@@ -2011,6 +2011,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
         getLimit = Move.getLimit,
         exceededLimit = Move.exceededLimit,
         translate = Move.translate;
+    var isSlide = Splide2.is(SLIDE);
     var interval;
     var callback;
     var friction = 1;
@@ -2024,7 +2025,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
       var from = getPosition();
       clear();
 
-      if (snap) {
+      if (snap && (!isSlide || !exceededLimit())) {
         var size = Components2.Layout.sliderSize();
         var offset = sign(destination) * size * floor(abs(destination) / size) || 0;
         destination = Move.toPosition(Components2.Controller.toDest(destination % size)) + offset;
@@ -2052,7 +2053,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
       var diff = (target - position) * friction;
       translate(position + diff);
 
-      if (Splide2.is(SLIDE) && !noConstrain && exceededLimit()) {
+      if (isSlide && !noConstrain && exceededLimit()) {
         friction *= FRICTION_FACTOR;
 
         if (abs(diff) < BOUNCE_DIFF_THRESHOLD) {

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1 - 1
dist/js/splide.min.js


BIN
dist/js/splide.min.js.gz


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/js/splide.min.js.map


+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "@splidejs/splide",
-  "version": "4.0.15",
+  "version": "4.0.16",
   "description": "Splide is a lightweight, flexible and accessible slider/carousel. No dependencies, no Lighthouse errors.",
   "author": "Naotoshi Fujita",
   "license": "MIT",

+ 3 - 2
src/js/components/Scroll/Scroll.ts

@@ -34,6 +34,7 @@ export function Scroll( Splide: Splide, Components: Components, options: Options
   const { state: { set } } = Splide;
   const { Move } = Components;
   const { getPosition, getLimit, exceededLimit, translate } = Move;
+  const isSlide = Splide.is( SLIDE );
 
   /**
    * Retains the active RequestInterval object.
@@ -78,7 +79,7 @@ export function Scroll( Splide: Splide, Components: Components, options: Options
 
     clear();
 
-    if ( snap ) {
+    if ( snap && ( ! isSlide || ! exceededLimit() ) ) {
       const size   = Components.Layout.sliderSize();
       const offset = sign( destination ) * size * floor( abs( destination ) / size ) || 0;
       destination = Move.toPosition( Components.Controller.toDest( destination % size ) ) + offset;
@@ -120,7 +121,7 @@ export function Scroll( Splide: Splide, Components: Components, options: Options
 
     translate( position + diff );
 
-    if ( Splide.is( SLIDE ) && ! noConstrain && exceededLimit() ) {
+    if ( isSlide && ! noConstrain && exceededLimit() ) {
       friction *= FRICTION_FACTOR;
 
       if ( abs( diff ) < BOUNCE_DIFF_THRESHOLD ) {

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä