modules/pointerEvents.js
function (root) {
        var current = root.prototype ? root.prototype.addEventListener : root.addEventListener;

        var customAddEventListener = function (name, func, capture) {
            // Branch when a PointerXXX is used
            if (supportedEventsNames.indexOf(name) !== -1) {
                setTouchAware(this, name, true);
            }

            if (current === undefined) {
                this.attachEvent('on' + getMouseEquivalentEventName(name), func);
            } else {
                current.call(this, name, func, capture);
            }
        };

        if (root.prototype) {
            root.prototype.addEventListener = customAddEventListener;
        } else {
            root.addEventListener = customAddEventListener;
        }
    }
function (root) {
        var current = root.prototype ? root.prototype.addEventListener : root.addEventListener;

        var customAddEventListener = function (name, func, capture) {
            // Branch when a PointerXXX is used
            if (supportedEventsNames.indexOf(name) !== -1) {
                setTouchAware(this, name, true);
            }

            if (current === undefined) {
                this.attachEvent('on' + getMouseEquivalentEventName(name), func);
            } else {
                current.call(this, name, func, capture);
            }
        };

        if (root.prototype) {
            root.prototype.addEventListener = customAddEventListener;
        } else {
            root.addEventListener = customAddEventListener;
        }
    }
function ( root ) { var current = root . prototype ? root . prototype . addEventListener : root . addEventListener ; var customAddEventListener = function ( name , func , capture ) { // Branch when a PointerXXX is used if ( supportedEventsNames . indexOf ( name ) !== - 1 ) { setTouchAware ( this , name , true ) ; } if ( current === undefined ) { this . attachEvent ( 'on' + getMouseEquivalentEventName ( name ) , func ) ; } else { current . call ( this , name , func , capture ) ; } } ; if ( root . prototype ) { root . prototype . addEventListener = customAddEventListener ; } else { root . addEventListener = customAddEventListener ; } }
Intercept addEventListener calls by changing the prototype
Intercept addEventListener calls by changing the prototype