function touchPointsNumberChanged(evt) {
        evt.preventDefault();
        if (Malakh.Magnifier) {
            that.disableMagnifier(); // TODO handle magnifier in touch mode, too?
        }

        $(document).off('touchmove.malakh', onTouchMove); // we'll register it again

        var targetTouches = evt.originalEvent.targetTouches;
        var targetTouchesLength = targetTouches.length;

        if (targetTouchesLength > 0) {
            lastPosition = getTouchCenter(targetTouches);
            if (targetTouchesLength > 1) {
                // Count the distance of the first touch point to the center;
                // pinch-to-zoom will be handled using it.
                lastTouchStretch = getLastTouchStretch(targetTouches[0]);
            }
            $(document).on('touchmove.malakh', onTouchMove);
        }

        that.restoreUpdating();
        malakh.$container.trigger('malakh:user_action');
    }
/**
     * Event handler for `touchstart` or `touchend`. Each time the number of touch points changes their center
     * of gravity is computed as well as the current distance of the first touch point to this gravity center. This
     * distance, saved in a <code>lastTouchStretch</code> variable is used to implement pinch-to-zoom.
     *
     * @param {jQuery.Event} evt  `touchstart` or `touchend` jQuery event.
     */
Event handler for `touchstart` or `touchend`. Each time the number of touch points changes their center
of gravity is computed as well as the current distance of the first touch point to this gravity center. This
distance, saved in a lastTouchStretch variable is used to implement pinch-to-zoom.

@param {jQuery.Event} evt  `touchstart` or `touchend` jQuery event.
Event handler for ` touchstart ` or ` touchend ` . Each time the number of touch points changes their center of gravity is computed as well as the current distance of the first touch point to this gravity center . This distance saved in a lastTouchStretch variable is used to implement pinch - to - zoom . @param { jQuery . Event } evt ` touchstart ` or ` touchend ` jQuery event .
function touchPointsNumberChanged(evt) {
        evt.preventDefault();
        if (Malakh.Magnifier) {
            that.disableMagnifier(); 
        }
        $(document).off('touchmove.malakh', onTouchMove); 
        var targetTouches = evt.originalEvent.targetTouches;
        var targetTouchesLength = targetTouches.length;
        if (targetTouchesLength > 0) {
            lastPosition = getTouchCenter(targetTouches);
            if (targetTouchesLength > 1) {
                lastTouchStretch = getLastTouchStretch(targetTouches[0]);
            }
            $(document).on('touchmove.malakh', onTouchMove);
        }
        that.restoreUpdating();
        malakh.$container.trigger('malakh:user_action');
    }
function touchPointsNumberChanged ( evt ) { evt . preventDefault ( ) ; if ( Malakh . Magnifier ) { that . disableMagnifier ( ) ; } $ ( document ) . off ( 'touchmove.malakh' , onTouchMove ) ; var targetTouches = evt . originalEvent . targetTouches ; var targetTouchesLength = targetTouches . length ; if ( targetTouchesLength > 0 ) { lastPosition = getTouchCenter ( targetTouches ) ; if ( targetTouchesLength > 1 ) { lastTouchStretch = getLastTouchStretch ( targetTouches [ 0 ] ) ; } $ ( document ) . on ( 'touchmove.malakh' , onTouchMove ) ; } that . restoreUpdating ( ) ; malakh . $container . trigger ( 'malakh:user_action' ) ; }
Event handler for `touchstart` or `touchend`.
Event handler for ` touchstart ` or ` touchend ` .
// TODO handle magnifier in touch mode, too? // we'll register it again // Count the distance of the first touch point to the center; // pinch-to-zoom will be handled using it.