src/captors/sigma.captors.touch.js
function _handleLeave(e) {
      if (_settings('touchEnabled')) {
        _downTouches = e.touches;
        var inertiaRatio = _settings('touchInertiaRatio');

        if (_movingTimeoutId) {
          _isMoving = false;
          clearTimeout(_movingTimeoutId);
        }

        switch (_touchMode) {
          case 2:
            if (e.touches.length === 1) {
              _handleStart(e);

              e.preventDefault();
              break;
            }
            /* falls through */
          case 1:
            _camera.isMoving = false;
            _self.dispatchEvent('stopDrag');

            if (_isMoving) {
              _doubleTap = false;
              sigma.misc.animation.camera(
                _camera,
                {
                  x: _camera.x +
                    inertiaRatio * (_camera.x - _lastCameraX),
                  y: _camera.y +
                    inertiaRatio * (_camera.y - _lastCameraY)
                },
                {
                  easing: 'quadraticOut',
                  duration: _settings('touchInertiaDuration')
                }
              );
            }

            _isMoving = false;
            _touchMode = 0;
            break;
        }
      }
    }
function _handleLeave(e) {
      if (_settings('touchEnabled')) {
        _downTouches = e.touches;
        var inertiaRatio = _settings('touchInertiaRatio');

        if (_movingTimeoutId) {
          _isMoving = false;
          clearTimeout(_movingTimeoutId);
        }

        switch (_touchMode) {
          case 2:
            if (e.touches.length === 1) {
              _handleStart(e);

              e.preventDefault();
              break;
            }
            /* falls through */
          case 1:
            _camera.isMoving = false;
            _self.dispatchEvent('stopDrag');

            if (_isMoving) {
              _doubleTap = false;
              sigma.misc.animation.camera(
                _camera,
                {
                  x: _camera.x +
                    inertiaRatio * (_camera.x - _lastCameraX),
                  y: _camera.y +
                    inertiaRatio * (_camera.y - _lastCameraY)
                },
                {
                  easing: 'quadraticOut',
                  duration: _settings('touchInertiaDuration')
                }
              );
            }

            _isMoving = false;
            _touchMode = 0;
            break;
        }
      }
    }
function _handleLeave ( e ) { if ( _settings ( 'touchEnabled' ) ) { _downTouches = e . touches ; var inertiaRatio = _settings ( 'touchInertiaRatio' ) ; if ( _movingTimeoutId ) { _isMoving = false ; clearTimeout ( _movingTimeoutId ) ; } switch ( _touchMode ) { case 2 : if ( e . touches . length === 1 ) { _handleStart ( e ) ; e . preventDefault ( ) ; break ; } /* falls through */ case 1 : _camera . isMoving = false ; _self . dispatchEvent ( 'stopDrag' ) ; if ( _isMoving ) { _doubleTap = false ; sigma . misc . animation . camera ( _camera , { x : _camera . x + inertiaRatio * ( _camera . x - _lastCameraX ) , y : _camera . y + inertiaRatio * ( _camera . y - _lastCameraY ) } , { easing : 'quadraticOut' , duration : _settings ( 'touchInertiaDuration' ) } ) ; } _isMoving = false ; _touchMode = 0 ; break ; } } }
The handler listening to the 'touchend', 'touchcancel' and 'touchleave'
event. It will update the touch mode if there are still at least one
finger, and stop dragging else.

@param {event} e A touch event.
The handler listening to the touchend touchcancel and touchleave event . It will update the touch mode if there are still at least one finger and stop dragging else .