Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to adjust the vertical drag sensibility #516

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions dist/flickity.pkgd.js
Original file line number Diff line number Diff line change
Expand Up @@ -1998,6 +1998,11 @@ if ( jQuery && jQuery.bridget ) {
jQuery.bridget( 'flickity', Flickity );
}

// set internal jQuery, for Webpack + jQuery v3, #478
Flickity.setJQuery = function( jq ) {
jQuery = jq;
};

Flickity.Cell = Cell;

return Flickity;
Expand Down Expand Up @@ -2632,7 +2637,10 @@ return Unidragger;

utils.extend( Flickity.defaults, {
draggable: true,
dragThreshold: 3,
dragThreshold: {
x: 3,
y: 3
}
});

// ----- create ----- //
Expand Down Expand Up @@ -2776,7 +2784,7 @@ proto.canPreventDefaultOnPointerDown = function( event ) {
// ----- move ----- //

proto.hasDragStarted = function( moveVector ) {
return Math.abs( moveVector.x ) > this.options.dragThreshold;
return Math.abs( moveVector.x ) > this.options.dragThreshold.x && Math.abs( moveVector.y ) < this.options.dragThreshold.y;
};

// ----- up ----- //
Expand Down Expand Up @@ -2809,7 +2817,6 @@ proto.pointerMove = function( event, pointer ) {
};

proto.dragMove = function( event, pointer, moveVector ) {
event.preventDefault();

this.previousDragX = this.dragX;
// reverse if right-to-left
Expand Down
Loading