extras/noUiSlider/nouislider.js
function fixEvent ( e, pageOffset ) {

            // Prevent scrolling and panning on touch events, while
            // attempting to slide. The tap event also depends on this.
            e.preventDefault();

            // Filter the event to register the type, which can be
            // touch, mouse or pointer. Offset changes need to be
            // made on an event specific basis.
            var touch = e.type.indexOf('touch') === 0;
            var mouse = e.type.indexOf('mouse') === 0;
            var pointer = e.type.indexOf('pointer') === 0;
            var x;
            var y;

            // IE10 implemented pointer events with a prefix;
            if ( e.type.indexOf('MSPointer') === 0 ) {
                pointer = true;
            }

            if ( touch ) {

                // Fix bug when user touches with two or more fingers on mobile devices.
                // It's useful when you have two or more sliders on one page,
                // that can be touched simultaneously.
                // #649, #663, #668
                if ( e.touches.length > 1 ) {
                    return false;
                }

                // noUiSlider supports one movement at a time,
                // so we can select the first 'changedTouch'.
                x = e.changedTouches[0].pageX;
                y = e.changedTouches[0].pageY;
            }

            pageOffset = pageOffset || getPageOffset();

            if ( mouse || pointer ) {
                x = e.clientX + pageOffset.x;
                y = e.clientY + pageOffset.y;
            }

            e.pageOffset = pageOffset;
            e.points = [x, y];
            e.cursor = mouse || pointer; // Fix #435

            return e;
        }
function fixEvent ( e, pageOffset ) {

            // Prevent scrolling and panning on touch events, while
            // attempting to slide. The tap event also depends on this.
            e.preventDefault();

            // Filter the event to register the type, which can be
            // touch, mouse or pointer. Offset changes need to be
            // made on an event specific basis.
            var touch = e.type.indexOf('touch') === 0;
            var mouse = e.type.indexOf('mouse') === 0;
            var pointer = e.type.indexOf('pointer') === 0;
            var x;
            var y;

            // IE10 implemented pointer events with a prefix;
            if ( e.type.indexOf('MSPointer') === 0 ) {
                pointer = true;
            }

            if ( touch ) {

                // Fix bug when user touches with two or more fingers on mobile devices.
                // It's useful when you have two or more sliders on one page,
                // that can be touched simultaneously.
                // #649, #663, #668
                if ( e.touches.length > 1 ) {
                    return false;
                }

                // noUiSlider supports one movement at a time,
                // so we can select the first 'changedTouch'.
                x = e.changedTouches[0].pageX;
                y = e.changedTouches[0].pageY;
            }

            pageOffset = pageOffset || getPageOffset();

            if ( mouse || pointer ) {
                x = e.clientX + pageOffset.x;
                y = e.clientY + pageOffset.y;
            }

            e.pageOffset = pageOffset;
            e.points = [x, y];
            e.cursor = mouse || pointer; // Fix #435

            return e;
        }
function fixEvent ( e , pageOffset ) { // Prevent scrolling and panning on touch events, while // attempting to slide. The tap event also depends on this. e . preventDefault ( ) ; // Filter the event to register the type, which can be // touch, mouse or pointer. Offset changes need to be // made on an event specific basis. var touch = e . type . indexOf ( 'touch' ) === 0 ; var mouse = e . type . indexOf ( 'mouse' ) === 0 ; var pointer = e . type . indexOf ( 'pointer' ) === 0 ; var x ; var y ; // IE10 implemented pointer events with a prefix; if ( e . type . indexOf ( 'MSPointer' ) === 0 ) { pointer = true ; } if ( touch ) { // Fix bug when user touches with two or more fingers on mobile devices. // It's useful when you have two or more sliders on one page, // that can be touched simultaneously. // #649, #663, #668 if ( e . touches . length > 1 ) { return false ; } // noUiSlider supports one movement at a time, // so we can select the first 'changedTouch'. x = e . changedTouches [ 0 ] . pageX ; y = e . changedTouches [ 0 ] . pageY ; } pageOffset = pageOffset || getPageOffset ( ) ; if ( mouse || pointer ) { x = e . clientX + pageOffset . x ; y = e . clientY + pageOffset . y ; } e . pageOffset = pageOffset ; e . points = [ x , y ] ; e . cursor = mouse || pointer ; // Fix #435 return e ; }
Provide a clean event with standardized offset values.
Provide a clean event with standardized offset values .