Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
[Prerelease] Bumped version number
Browse files Browse the repository at this point in the history
  • Loading branch information
Wikiki committed May 13, 2018
1 parent fc4422a commit 38fc319
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<a name="2.0.10"></a>
## [2.0.10](https://github.com/Wikiki/bulma-carousel/compare/2.0.9...2.0.10) (2018-05-13)



<a name="2.0.9"></a>
## [2.0.9](https://github.com/Wikiki/bulma-carousel/compare/2.0.8...2.0.9) (2018-05-11)

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "bulma-carousel",
"description": "Display a Image / Content carousel",
"main": "carousel.sass",
"version": "2.0.9",
"version": "2.0.10",
"authors": [
"Wikiki <[email protected]> (https://wikiki.github.io/bulma-extensions/overview)"
],
Expand Down
14 changes: 5 additions & 9 deletions dist/bulma-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ class Carousel extends EventEmitter {

/// Set default options and merge with instance defined
this.options = Object.assign({}, {
threshold: 150, //required min distance traveled to be considered swipe
threshold: 50, //required min distance traveled to be considered swipe
restraint: 100, // maximum distance allowed at the same time in perpendicular direction
allowedTime: 300 // maximum time allowed to travel that distance
allowedTime: 500 // maximum time allowed to travel that distance
});

this.init();
Expand Down Expand Up @@ -302,18 +302,12 @@ class Carousel extends EventEmitter {
this.carousel.addEventListener('touchstart', e => {
this._swipeStart(e);
});
this.carousel.addEventListener('mousedown', e => {
this._swipeStart(e);
});
this.carousel.addEventListener('touchmove', e => {
e.preventDefault();
});
this.carousel.addEventListener('touchend', e => {
this._swipeEnd(e);
});
this.carousel.addEventListener('mouseup', e => {
this._swipeEnd(e);
});
}

/**
Expand Down Expand Up @@ -376,6 +370,7 @@ class Carousel extends EventEmitter {
*/
_swipeStart(e) {
e.preventDefault();

this._touch = {
start: {
time: new Date().getTime(), // record time when finger first makes contact with surface
Expand All @@ -397,6 +392,7 @@ class Carousel extends EventEmitter {
*/
_swipeEnd(e) {
e.preventDefault();

const touchObj = e.changedTouches[0];
this._touch.dist = {
x: touchObj.pageX - this._touch.start.x, // get horizontal dist traveled by finger while in contact with surface
Expand All @@ -412,7 +408,7 @@ class Carousel extends EventEmitter {
* @return {void}
*/
_handleGesture() {
elapsedTime = new Date().getTime() - this._touch.start.time; // get time elapsed
const elapsedTime = new Date().getTime() - this._touch.start.time; // get time elapsed
if (elapsedTime <= this.options.allowedTime) { // first condition for awipe met
if (Math.abs(this._touch.dist.x) >= this.options.threshold && Math.abs(this._touch.dist.y) <= this.options.restraint) { // 2nd condition for horizontal swipe met
(this._touch.dist.x < 0) ? this._slide('next') : this._slide('previous'); // if dist traveled is negative, it indicates left swipe
Expand Down
2 changes: 1 addition & 1 deletion dist/bulma-carousel.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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bulma-carousel",
"version": "2.0.9",
"version": "2.0.10",
"description": "Display a Image / Content carousel",
"main": "dist/bulma-carousel.sass",
"scripts": {
Expand Down

0 comments on commit 38fc319

Please sign in to comment.