function touchHandler()

in pysteve/www/htdocs/js/steve_stv.js [683:703]


function touchHandler(event) {
    var touch = event.changedTouches[0];
    for (var i in event.changedTouches) {
        if (event.changedTouches[i].target && event.changedTouches[i].target.getAttribute ) {
            touch = event.changedTouches[i]
            break
        }
    }
    if (!touch.target || !touch.target.getAttribute || !touch.target.getAttribute("data")) {
        return
    }
    
    if (event.type == 'touchstart') {
        dragVote(touch)
    }
    if (event.type == 'touchend' || event.type == 'touchcancel') {
        tb = touch.target.getAttribute('data')
        dropCandidate(touch)
    }
    event.preventDefault();
}