src/aria/touch/Gesture.js
function (event, name, extraData) {
            var target = (event.target) ? event.target : event.srcElement;
            var fakeEvent = aria.DomEvent.getFakeEvent(name, target);
            if (!event.returnValue) {
                fakeEvent.preventDefault();
            }
            if (event.cancelBubble) {
                fakeEvent.stopPropagation();
            }
            fakeEvent.pageX = event.pageX;
            fakeEvent.pageY = event.pageY;
            fakeEvent.clientX = event.clientX;
            fakeEvent.clientY = event.clientY;
            fakeEvent.touches = event.touches;
            fakeEvent.changedTouches = event.changedTouches;
            fakeEvent.isPrimary = event.isPrimary;
            if (this.startData) {
                if (this.startData.time) {
                    fakeEvent.duration = (new Date()).getTime() - this.startData.time;
                }
            }
            if (!extraData) {
                extraData = {};
            }
            extraData.startX = this.startData.positions[0].x;
            extraData.startY = this.startData.positions[0].y;
            var position = ariaTouchEvent.getPositions(event);
            extraData.currentX = position[0].x;
            extraData.currentY = position[0].y;
            fakeEvent.detail = extraData;
            ariaUtilsDelegate.delegate(fakeEvent);
            event.cancelBubble = fakeEvent.hasStopPropagation;
            event.returnValue = !fakeEvent.hasPreventDefault;
            return event.returnValue;
        }
function (event, name, extraData) {
            var target = (event.target) ? event.target : event.srcElement;
            var fakeEvent = aria.DomEvent.getFakeEvent(name, target);
            if (!event.returnValue) {
                fakeEvent.preventDefault();
            }
            if (event.cancelBubble) {
                fakeEvent.stopPropagation();
            }
            fakeEvent.pageX = event.pageX;
            fakeEvent.pageY = event.pageY;
            fakeEvent.clientX = event.clientX;
            fakeEvent.clientY = event.clientY;
            fakeEvent.touches = event.touches;
            fakeEvent.changedTouches = event.changedTouches;
            fakeEvent.isPrimary = event.isPrimary;
            if (this.startData) {
                if (this.startData.time) {
                    fakeEvent.duration = (new Date()).getTime() - this.startData.time;
                }
            }
            if (!extraData) {
                extraData = {};
            }
            extraData.startX = this.startData.positions[0].x;
            extraData.startY = this.startData.positions[0].y;
            var position = ariaTouchEvent.getPositions(event);
            extraData.currentX = position[0].x;
            extraData.currentY = position[0].y;
            fakeEvent.detail = extraData;
            ariaUtilsDelegate.delegate(fakeEvent);
            event.cancelBubble = fakeEvent.hasStopPropagation;
            event.returnValue = !fakeEvent.hasPreventDefault;
            return event.returnValue;
        }
function ( event , name , extraData ) { var target = ( event . target ) ? event . target : event . srcElement ; var fakeEvent = aria . DomEvent . getFakeEvent ( name , target ) ; if ( ! event . returnValue ) { fakeEvent . preventDefault ( ) ; } if ( event . cancelBubble ) { fakeEvent . stopPropagation ( ) ; } fakeEvent . pageX = event . pageX ; fakeEvent . pageY = event . pageY ; fakeEvent . clientX = event . clientX ; fakeEvent . clientY = event . clientY ; fakeEvent . touches = event . touches ; fakeEvent . changedTouches = event . changedTouches ; fakeEvent . isPrimary = event . isPrimary ; if ( this . startData ) { if ( this . startData . time ) { fakeEvent . duration = ( new Date ( ) ) . getTime ( ) - this . startData . time ; } } if ( ! extraData ) { extraData = { } ; } extraData . startX = this . startData . positions [ 0 ] . x ; extraData . startY = this . startData . positions [ 0 ] . y ; var position = ariaTouchEvent . getPositions ( event ) ; extraData . currentX = position [ 0 ] . x ; extraData . currentY = position [ 0 ] . y ; fakeEvent . detail = extraData ; ariaUtilsDelegate . delegate ( fakeEvent ) ; event . cancelBubble = fakeEvent . hasStopPropagation ; event . returnValue = ! fakeEvent . hasPreventDefault ; return event . returnValue ; }
Raises a fake event, using Delegate.delegate to accurately delegate the event to the appropriate DOM element.
@param {Object} event the original event
@param {String} name the fake event name
@protected
@return {Boolean} false if preventDefault is true
Raises a fake event using Delegate . delegate to accurately delegate the event to the appropriate DOM element .