Skip to content

Commit

Permalink
removes straggling mouse events. getting rid of desktop drag. refines…
Browse files Browse the repository at this point in the history
… threshold for click vs drag.
  • Loading branch information
Amanda Dinstel committed Mar 1, 2016
1 parent 94aeb8f commit 193f41d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,10 @@


// Attach mouse and touch events for swipe / drag
$slideBody.on('mousedown touchstart', function(e){
$slideBody.on('touchstart', function(e){

peekABoo.startTime = new Date().getTime();

if (e.type == 'mousedown'){
peekABoo.dragStartMousePosX = peekABoo.getMousePos(e).posx;
}

peekABoo.startTime = new Date().getTime();

if (e.type == 'touchstart'){
peekABoo.dragStartMousePosX = e.originalEvent.touches[0].pageX;
}
Expand Down Expand Up @@ -795,7 +791,7 @@

peekABoo.endTime = new Date().getTime();

if (peekABoo.endTime - peekABoo.startTime < 50) {
if (peekABoo.endTime - peekABoo.startTime < 150) {
return false;
}

Expand Down

0 comments on commit 193f41d

Please sign in to comment.