Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Drag threshold directions (almende#3003) #4286

Open
wants to merge 4 commits into
base: develop
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
2 changes: 1 addition & 1 deletion lib/timeline/Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Core.prototype._create = function (container) {
this.hammer = new Hammer(this.dom.root);
var pinchRecognizer = this.hammer.get('pinch').set({enable: true});
pinchRecognizer && hammerUtil.disablePreventDefaultVertically(pinchRecognizer);
this.hammer.get('pan').set({threshold:5, direction: Hammer.DIRECTION_HORIZONTAL});
this.hammer.get('pan').set({threshold:5, direction: Hammer.DIRECTION_ALL});
this.listeners = {};

var events = [
Expand Down
2 changes: 1 addition & 1 deletion lib/timeline/component/CustomTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ CustomTime.prototype._create = function() {
this.hammer.on('panstart', this._onDragStart.bind(this));
this.hammer.on('panmove', this._onDrag.bind(this));
this.hammer.on('panend', this._onDragEnd.bind(this));
this.hammer.get('pan').set({ threshold: 5, direction: Hammer.DIRECTION_HORIZONTAL });
this.hammer.get('pan').set({ threshold: 5, direction: Hammer.DIRECTION_ALL });
}
};

Expand Down
2 changes: 1 addition & 1 deletion lib/timeline/component/ItemSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ ItemSet.prototype._create = function(){
this.hammer.on('panstart', this._onDragStart.bind(this));
this.hammer.on('panmove', this._onDrag.bind(this));
this.hammer.on('panend', this._onDragEnd.bind(this));
this.hammer.get('pan').set({threshold:5, direction: Hammer.DIRECTION_HORIZONTAL});
this.hammer.get('pan').set({threshold:5, direction: Hammer.DIRECTION_ALL});

// single select (or unselect) when tapping an item
this.hammer.on('tap', this._onSelectItem.bind(this));
Expand Down