Skip to content

Commit

Permalink
Merge pull request #26 from gabrielbiga/swipereponse
Browse files Browse the repository at this point in the history
Change swipe gesture for a better tactic response
  • Loading branch information
bradmartin committed Jun 1, 2016
2 parents 83b8817 + 90bd5c0 commit 54d49ff
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fab-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ var FloatingActionButton = (function (_super) {
if(swipeItem !== undefined){
var duration = (this.hideAnimationDuration) ? this.hideAnimationDuration : this.getDurationDefault(animationType);

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

}
//Swipe Down
else if (args.direction === 8) {
else {
switch(animationType){
case "slideUp":
fab.animate({ translate: { x: 0, y: 0 }, opacity: 1, duration: duration });
Expand Down

0 comments on commit 54d49ff

Please sign in to comment.