src/js/hammer.js
function(input) {
        var state = this.state;
        var eventType = input.eventType;

        var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
        var isValid = this.attrTest(input);

        // on cancel input and we've recognized before, return STATE_CANCELLED
        if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
            return state | STATE_CANCELLED;
        } else if (isRecognized || isValid) {
            if (eventType & INPUT_END) {
                return state | STATE_ENDED;
            } else if (!(state & STATE_BEGAN)) {
                return STATE_BEGAN;
            }
            return state | STATE_CHANGED;
        }
        return STATE_FAILED;
    }
function(input) {
        var state = this.state;
        var eventType = input.eventType;

        var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
        var isValid = this.attrTest(input);

        // on cancel input and we've recognized before, return STATE_CANCELLED
        if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
            return state | STATE_CANCELLED;
        } else if (isRecognized || isValid) {
            if (eventType & INPUT_END) {
                return state | STATE_ENDED;
            } else if (!(state & STATE_BEGAN)) {
                return STATE_BEGAN;
            }
            return state | STATE_CHANGED;
        }
        return STATE_FAILED;
    }
function ( input ) { var state = this . state ; var eventType = input . eventType ; var isRecognized = state & ( STATE_BEGAN | STATE_CHANGED ) ; var isValid = this . attrTest ( input ) ; // on cancel input and we've recognized before, return STATE_CANCELLED if ( isRecognized && ( eventType & INPUT_CANCEL || ! isValid ) ) { return state | STATE_CANCELLED ; } else if ( isRecognized || isValid ) { if ( eventType & INPUT_END ) { return state | STATE_ENDED ; } else if ( ! ( state & STATE_BEGAN ) ) { return STATE_BEGAN ; } return state | STATE_CHANGED ; } return STATE_FAILED ; }
Process the input and return the state for the recognizer
@memberof AttrRecognizer
@param {Object} input
@returns {*} State
Process the input and return the state for the recognizer