src/lib/touchhandler.js
function(evt) {
        evt.preventDefault();
        evt.stopPropagation();

        // Calculate actual height of element so we can calculate bounds properly
        positionable.rect = positionable.refs.styleWrapper.getBoundingClientRect();

        if (debug) { timedLog("startmark"); }
        if(!evt.touches || evt.touches.length === 1) {
          if (debug) { timedLog("startmark - continued"); }
          mark = copy(positionable.state);
          transform.x1 = evt.clientX || evt.touches[0].pageX;
          transform.y1 = evt.clientY || evt.touches[0].pageY;
          positionable.setState({ touchactive: true });
        } else { handlers.secondFinger(evt); }

        var timeStart = new Date();

        //For detecting taps
        tapStart = {
          x1: evt.touches[0].pageX,
          y1: evt.touches[0].pageY,
          timeStart: timeStart
        };
      }
function(evt) {
        evt.preventDefault();
        evt.stopPropagation();

        // Calculate actual height of element so we can calculate bounds properly
        positionable.rect = positionable.refs.styleWrapper.getBoundingClientRect();

        if (debug) { timedLog("startmark"); }
        if(!evt.touches || evt.touches.length === 1) {
          if (debug) { timedLog("startmark - continued"); }
          mark = copy(positionable.state);
          transform.x1 = evt.clientX || evt.touches[0].pageX;
          transform.y1 = evt.clientY || evt.touches[0].pageY;
          positionable.setState({ touchactive: true });
        } else { handlers.secondFinger(evt); }

        var timeStart = new Date();

        //For detecting taps
        tapStart = {
          x1: evt.touches[0].pageX,
          y1: evt.touches[0].pageY,
          timeStart: timeStart
        };
      }
function ( evt ) { evt . preventDefault ( ) ; evt . stopPropagation ( ) ; // Calculate actual height of element so we can calculate bounds properly positionable . rect = positionable . refs . styleWrapper . getBoundingClientRect ( ) ; if ( debug ) { timedLog ( "startmark" ) ; } if ( ! evt . touches || evt . touches . length === 1 ) { if ( debug ) { timedLog ( "startmark - continued" ) ; } mark = copy ( positionable . state ) ; transform . x1 = evt . clientX || evt . touches [ 0 ] . pageX ; transform . y1 = evt . clientY || evt . touches [ 0 ] . pageY ; positionable . setState ( { touchactive : true } ) ; } else { handlers . secondFinger ( evt ) ; } var timeStart = new Date ( ) ; //For detecting taps tapStart = { x1 : evt . touches [ 0 ] . pageX , y1 : evt . touches [ 0 ] . pageY , timeStart : timeStart } ; }
mark the first touch event so we can perform computation
relative to that coordinate.
mark the first touch event so we can perform computation relative to that coordinate .