Skip to content

Commit

Permalink
Refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
NaotoshiFujita committed Feb 25, 2022
1 parent e1d0a40 commit 0cad6ff
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 9 deletions.
4 changes: 1 addition & 3 deletions dist/js/splide.js
Original file line number Diff line number Diff line change
Expand Up @@ -2227,9 +2227,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
if (isFree) {
Controller.scroll(destination);
} else if (Splide2.is(FADE)) {
var length = Splide2.length;
var index = Splide2.index + orient(sign(velocity));
Controller.go(rewind ? (index + length) % length : index);
Controller.go(orient(sign(velocity)) < 0 ? rewind ? "<" : "-" : rewind ? ">" : "+");
} else if (Splide2.is(SLIDE) && exceeded && rewind) {
Controller.go(exceededLimit(true) ? ">" : "<");
} else {
Expand Down
2 changes: 1 addition & 1 deletion dist/js/splide.min.js

Large diffs are not rendered by default.

Binary file modified dist/js/splide.min.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/js/splide.min.js.map

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions src/js/components/Drag/Drag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,7 @@ export function Drag( Splide: Splide, Components: Components, options: Options )
if ( isFree ) {
Controller.scroll( destination );
} else if ( Splide.is( FADE ) ) {
const { length } = Splide;
const index = Splide.index + orient( sign( velocity ) );
Controller.go( rewind ? ( index + length ) % length : index );
Controller.go( orient( sign( velocity ) ) < 0 ? ( rewind ? '<' : '-' ) : ( rewind ? '>' : '+' ) );
} else if ( Splide.is( SLIDE ) && exceeded && rewind ) {
Controller.go( exceededLimit( true ) ? '>' : '<' );
} else {
Expand Down
3 changes: 2 additions & 1 deletion src/js/test/php/examples/fade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
document.addEventListener( 'DOMContentLoaded', function () {
var splide = new Splide( '#splide01', {
width: 800,
direction: 'rtl',
type : 'fade',
rewind: false,
// rewindByDrag: true,
rewindByDrag: false,
autoplay: true,
interval: 1000,
breakpoints: {
Expand Down

0 comments on commit 0cad6ff

Please sign in to comment.