Skip to content

Commit

Permalink
Return the splide instance in some APIs.
Browse files Browse the repository at this point in the history
  • Loading branch information
NaotoshiFujita committed Jan 31, 2020
1 parent 015dccd commit 33fbf23
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
7 changes: 6 additions & 1 deletion dist/js/splide.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Splide.js
* Version : 1.4.0
* Version : 1.4.1
* License : MIT
* Copyright: 2019 Naotoshi Fujita
*/
Expand Down Expand Up @@ -1516,6 +1516,8 @@ function () {
if (this.State.is(IDLE) || this.State.is(MOVING) && !wait) {
this.Components.Controller.go(control, false);
}

return this;
}
/**
* Verify whether the slider type is the given one or not.
Expand Down Expand Up @@ -1544,6 +1546,7 @@ function () {

this.Components.Elements.add(slide, index);
this.refresh();
return this;
}
/**
* Remove the slide designated by the index.
Expand All @@ -1555,6 +1558,7 @@ function () {
_proto.remove = function remove(index) {
this.Components.Elements.remove(index);
this.refresh();
return this;
}
/**
* Destroy all Slide objects and clones and recreate them again.
Expand All @@ -1564,6 +1568,7 @@ function () {

_proto.refresh = function refresh() {
this.emit('refresh').emit('updated', this.options);
return this;
}
/**
* Destroy the Splide.
Expand Down
4 changes: 2 additions & 2 deletions 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 package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@splidejs/splide",
"version": "1.4.0",
"version": "1.4.1",
"description": "Splide is a lightweight and powerful slider without any dependencies.",
"author": "Naotoshi Fujita",
"license": "MIT",
Expand Down
5 changes: 5 additions & 0 deletions src/js/splide.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ export default class Splide {
if ( this.State.is( STATES.IDLE ) || ( this.State.is( STATES.MOVING ) && ! wait ) ) {
this.Components.Controller.go( control, false );
}

return this;
}

/**
Expand All @@ -174,6 +176,7 @@ export default class Splide {
add( slide, index = -1 ) {
this.Components.Elements.add( slide, index );
this.refresh();
return this;
}

/**
Expand All @@ -184,6 +187,7 @@ export default class Splide {
remove( index ) {
this.Components.Elements.remove( index );
this.refresh();
return this;
}

/**
Expand All @@ -192,6 +196,7 @@ export default class Splide {
*/
refresh() {
this.emit( 'refresh' ).emit( 'updated', this.options );
return this;
}

/**
Expand Down

0 comments on commit 33fbf23

Please sign in to comment.