Skip to content

Commit

Permalink
Updated version
Browse files Browse the repository at this point in the history
  • Loading branch information
rinodrummer committed Jul 17, 2019
1 parent d6e36bd commit 65bfe45
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
21 changes: 15 additions & 6 deletions dist/slideshow.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ function Slideshow(_ref) {


var interval = function () {
if (duration > 0 && typeof Interval === 'function') {
new Interval({
if (duration > 0 && 'Interval' in window) {
return new Interval({
callback: function callback() {
that.next();
},
Expand Down Expand Up @@ -339,7 +339,7 @@ function Slideshow(_ref) {
/**
* Sets the current slide.
*
* @param {number|HTMLElement|Node} slide Index of the element or the
* @param {string|number|HTMLElement|Node} slide Index of the element or the
* element itself to bet setted as
* current.
*
Expand All @@ -356,7 +356,11 @@ function Slideshow(_ref) {

this.set = function (slide) {
if (slide == null) {
throw new Error('The given element is not a valid value. Please, insert an integer or a DOM element.');
throw new Error('The given element is not a valid value. Please, insert a string, an integer or a DOM element.');
}

if (typeof slide === 'string') {
slide = document.querySelector(slide);
}

if (typeof slide === 'number') {
Expand All @@ -374,7 +378,7 @@ function Slideshow(_ref) {
throw new Error('The given element is not in this slideshow.');
}
} else {
throw new Error('The given element is not a valid value. Please, insert an integer or a DOM element.');
throw new Error('The given element is not a valid value. Please, insert a string, an integer or a DOM element.');
}

var oldCurrent = current;
Expand Down Expand Up @@ -471,6 +475,11 @@ function Slideshow(_ref) {
};

if (interval) {
interval.startInterval();
interval.startInterval({
callback: function callback() {
that.next();
},
ms: duration
});
}
}
2 changes: 1 addition & 1 deletion dist/slideshow.js.min.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/slideshow.min.js

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

2 changes: 1 addition & 1 deletion docs/slideshow.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Slideshow
**Kind**: global class
**Version**: 1.0.1
**Version**: 1.0.2
**Author:** Gennaro Landolfi <[email protected]>

* [Slideshow](#Slideshow)
Expand Down
2 changes: 1 addition & 1 deletion src/slideshow.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @param {boolean} [param.swipe=false]
* @param {boolean} [param.throwsSlideIndexError=false]
*
* @version 1.0.2
* @version 1.0.3
*
* @author Gennaro Landolfi <[email protected]>
*/
Expand Down

0 comments on commit 65bfe45

Please sign in to comment.