Browse Source

Remove the `arrowSameIndex` argument.

Naotoshi Fujita 2 years ago
parent
commit
46c229253f

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

@@ -1358,7 +1358,7 @@ const Controller = (Splide, Components, options, event) => {
       emit(EVENT_END_INDEX_CHANGED);
     }
   }
-  function go(control, allowSameIndex, callback) {
+  function go(control, callback) {
     if (!isBusy()) {
       const dest = parse(control);
       const index = loop(dest);
@@ -1568,7 +1568,7 @@ const Arrows = (Splide, Components, options, event) => {
     bind(prev, "click", apply(go, "<"));
   }
   function go(control) {
-    Controller.go(control, true);
+    Controller.go(control);
   }
   function createArrows() {
     wrapper = placeholder || create("div", classes.arrows);
@@ -1883,7 +1883,7 @@ const Drag = (Splide, Components, options, event) => {
     } else if (Splide.is(SLIDE) && exceeded && rewind) {
       Controller.go(exceededLimit(true) ? ">" : "<");
     } else {
-      Controller.go(Controller.toDest(destination), true);
+      Controller.go(Controller.toDest(destination));
     }
     reduce(true);
   }
@@ -2110,7 +2110,7 @@ const Pagination = (Splide, Components, options, event) => {
       const controls = Slides.getIn(i).map((Slide) => Slide.slide.id);
       const text = !hasFocus() && perPage > 1 ? i18n.pageX : i18n.slideX;
       bind(button, "click", () => {
-        go(`>${i}`, true);
+        go(`>${i}`);
       });
       paginationKeyboard && bind(button, "keydown", apply(onKeydown, i));
       setAttribute(li, ROLE, "presentation");

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

@@ -1354,7 +1354,7 @@ const Controller = (Splide, Components, options, event) => {
       emit(EVENT_END_INDEX_CHANGED);
     }
   }
-  function go(control, allowSameIndex, callback) {
+  function go(control, callback) {
     if (!isBusy()) {
       const dest = parse(control);
       const index = loop(dest);
@@ -1564,7 +1564,7 @@ const Arrows = (Splide, Components, options, event) => {
     bind(prev, "click", apply(go, "<"));
   }
   function go(control) {
-    Controller.go(control, true);
+    Controller.go(control);
   }
   function createArrows() {
     wrapper = placeholder || create("div", classes.arrows);
@@ -1879,7 +1879,7 @@ const Drag = (Splide, Components, options, event) => {
     } else if (Splide.is(SLIDE) && exceeded && rewind) {
       Controller.go(exceededLimit(true) ? ">" : "<");
     } else {
-      Controller.go(Controller.toDest(destination), true);
+      Controller.go(Controller.toDest(destination));
     }
     reduce(true);
   }
@@ -2106,7 +2106,7 @@ const Pagination = (Splide, Components, options, event) => {
       const controls = Slides.getIn(i).map((Slide) => Slide.slide.id);
       const text = !hasFocus() && perPage > 1 ? i18n.pageX : i18n.slideX;
       bind(button, "click", () => {
-        go(`>${i}`, true);
+        go(`>${i}`);
       });
       paginationKeyboard && bind(button, "keydown", apply(onKeydown, i));
       setAttribute(li, ROLE, "presentation");

+ 4 - 4
dist/js/splide.js

@@ -1354,7 +1354,7 @@
         emit(EVENT_END_INDEX_CHANGED);
       }
     }
-    function go(control, allowSameIndex, callback) {
+    function go(control, callback) {
       if (!isBusy()) {
         const dest = parse(control);
         const index = loop(dest);
@@ -1564,7 +1564,7 @@
       bind(prev, "click", apply(go, "<"));
     }
     function go(control) {
-      Controller.go(control, true);
+      Controller.go(control);
     }
     function createArrows() {
       wrapper = placeholder || create("div", classes.arrows);
@@ -1879,7 +1879,7 @@
       } else if (Splide.is(SLIDE) && exceeded && rewind) {
         Controller.go(exceededLimit(true) ? ">" : "<");
       } else {
-        Controller.go(Controller.toDest(destination), true);
+        Controller.go(Controller.toDest(destination));
       }
       reduce(true);
     }
@@ -2106,7 +2106,7 @@
         const controls = Slides.getIn(i).map((Slide) => Slide.slide.id);
         const text = !hasFocus() && perPage > 1 ? i18n.pageX : i18n.slideX;
         bind(button, "click", () => {
-          go(`>${i}`, true);
+          go(`>${i}`);
         });
         paginationKeyboard && bind(button, "keydown", apply(onKeydown, i));
         setAttribute(li, ROLE, "presentation");

File diff suppressed because it is too large
+ 0 - 0
dist/js/splide.min.js


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


File diff suppressed because it is too large
+ 0 - 0
dist/js/splide.min.js.map


+ 1 - 1
dist/types/index.d.ts

@@ -234,7 +234,7 @@ interface MoveComponent extends BaseComponent {
  * @since 3.0.0
  */
 interface ControllerComponent extends BaseComponent {
-    go(control: number | string, allowSameIndex?: boolean, callback?: AnyFunction): void;
+    go(control: number | string, callback?: AnyFunction): void;
     jump(control: number | string): void;
     scroll(destination: number, duration?: number, snap?: boolean, callback?: AnyFunction): void;
     getNext(destination?: boolean): number;

+ 1 - 1
src/js/components/Arrows/Arrows.ts

@@ -158,7 +158,7 @@ export const Arrows: ComponentConstructor<ArrowsComponent> = ( Splide, Component
    * @param control - The control pattern.
    */
   function go( control: string ): void {
-    Controller.go( control, true );
+    Controller.go( control );
   }
 
   /**

+ 4 - 5
src/js/components/Controller/Controller.ts

@@ -11,7 +11,7 @@ import { apply, approximatelyEqual, between, clamp, floor, isString, isUndefined
  * @since 3.0.0
  */
 export interface ControllerComponent extends BaseComponent {
-  go( control: number | string, allowSameIndex?: boolean, callback?: AnyFunction ): void;
+  go( control: number | string, callback?: AnyFunction ): void;
   jump( control: number | string ): void;
   scroll( destination: number, duration?: number, snap?: boolean, callback?: AnyFunction ): void;
   getNext( destination?: boolean ): number;
@@ -128,11 +128,10 @@ export const Controller: ComponentConstructor<ControllerComponent> = ( Splide, C
    *
    * @see `Splide#go()`
    *
-   * @param control        - A control pattern.
-   * @param allowSameIndex - Optional. Determines whether to allow going to the current index or not.
-   * @param callback       - Optional. A callback function invoked after transition ends.
+   * @param control  - A control pattern.
+   * @param callback - Optional. A callback function invoked after transition ends.
    */
-  function go( control: number | string, allowSameIndex?: boolean, callback?: AnyFunction ): void {
+  function go( control: number | string, callback?: AnyFunction ): void {
     if ( ! isBusy() ) {
       const dest  = parse( control );
       const index = loop( dest );

+ 1 - 1
src/js/components/Drag/Drag.ts

@@ -243,7 +243,7 @@ export const Drag: ComponentConstructor<DragComponent> = ( Splide, Components, o
     } else if ( Splide.is( SLIDE ) && exceeded && rewind ) {
       Controller.go( exceededLimit( true ) ? '>' : '<' );
     } else {
-      Controller.go( Controller.toDest( destination ), true );
+      Controller.go( Controller.toDest( destination ) );
     }
 
     reduce( true );

+ 1 - 1
src/js/components/Pagination/Pagination.ts

@@ -158,7 +158,7 @@ export const Pagination: ComponentConstructor<PaginationComponent> = ( Splide, C
       const controls = Slides.getIn( i ).map( Slide => Slide.slide.id );
       const text     = ! hasFocus() && perPage > 1 ? i18n.pageX : i18n.slideX;
 
-      bind( button, 'click', () => { go( `>${ i }`, true ) } );
+      bind( button, 'click', () => { go( `>${ i }` ) } );
       paginationKeyboard && bind( button, 'keydown', apply( onKeydown, i ) );
 
       setAttribute( li, ROLE, 'presentation' );

Some files were not shown because too many files changed in this diff