Skip to content

Commit 54d49ff

Browse files
committed
Merge pull request #26 from gabrielbiga/swipereponse
Change swipe gesture for a better tactic response
2 parents 83b8817 + 90bd5c0 commit 54d49ff

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fab-common.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ var FloatingActionButton = (function (_super) {
3636
if(swipeItem !== undefined){
3737
var duration = (this.hideAnimationDuration) ? this.hideAnimationDuration : this.getDurationDefault(animationType);
3838

39-
swipeItem.on("swipe", function (args) {
39+
swipeItem.on("pan", function (args) {
40+
var delta = args.deltaY;
4041
//Swipe up
41-
if (args.direction === 4) {
42+
if (delta < 0) {
4243
switch(animationType){
4344
case "slideUp":
4445
fab.animate({ translate: { x: 0, y: -200 }, opacity: 0, duration: duration });
@@ -59,7 +60,7 @@ var FloatingActionButton = (function (_super) {
5960

6061
}
6162
//Swipe Down
62-
else if (args.direction === 8) {
63+
else {
6364
switch(animationType){
6465
case "slideUp":
6566
fab.animate({ translate: { x: 0, y: 0 }, opacity: 1, duration: duration });

0 commit comments

Comments
 (0)