Last active
December 14, 2015 00:59
-
-
Save rblalock/5002371 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Custom swipe detection for table rows (since technically the "swipe" | |
// event doesn't apply to individual rows but rather the table. This way we | |
// don't have to assign a swipe event for each row. One event to manage | |
// them all is more performant. | |
var TOUCH_X = 0; | |
$.list.addEventListener("touchstart", function(e) { | |
TOUCH_X = e.x; | |
}); | |
$.list.addEventListener("touchend", function(e) { | |
if(e.x > (TOUCH_X + 44)) { | |
// Do things here to the row like add a view overlay that slides in | |
// e.g. e.source.add( Alloy.createController("rowOverlay") ); ...etc. | |
} else if(e.x < (TOUCH_X - 44)) { | |
// Do things here to the row like add a view overlay that slides in | |
// e.g. e.source.add( Alloy.createController("rowOverlay") ); ...etc. | |
} | |
TOUCH_X = e.x; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment