Results 1 to 5 of 5

Thread: Disable touch gesture recognizers

    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-2300 in a recent build.
  1. #1

    Default Disable touch gesture recognizers

    I'm trying to disable unused touch gesture recognizers. I use the eventPublishers configuration in Ext.application like described in the documentation, setting properties like doubleTap or swipe to null:
    Code:
    Ext.application({
        eventPublishers: {
            touchGesture: {
                recognizers: {
                    doubleTap: null,
                    longPress: null,
                    swipe: null,
                    pinch: null,
                    rotate: null
                }
            }
        },
        // 
    });
    But i only get the following error in Ext.event.publisher.TouchGesture#registerRecognizer:
    Uncaught TypeError: Cannot call method 'getHandledEvents' of null

    It simply doesn't seem to be possible right now to disable recognizers.

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

    Thank you for the report.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661

    Default

    This should resolve your issue, it will be included in the next release. Please let me know if you still have the issue:

    Code:
    Ext.define('Ext.override.Recognizer', {
        override: 'Ext.event.publisher.TouchGesture',
        applyRecognizers: function(recognizers) {
            var i, recognizer;
    
            for (i in recognizers) {
                if (recognizers.hasOwnProperty(i)) {
                    recognizer = recognizers[i];
    
                    if (recognizer) {
                        this.registerRecognizer(recognizer);
                    }
                }
            }
    
            return recognizers;
        }
    });
    Last edited by Jamie Avins; 2 Mar 2012 at 4:47 PM. Reason: Actually put in the fix...

    Sencha Inc

    Jamie Avins

    @jamieavins

  4. #4

    Default

    That's working for me, thank you.

  5. #5
    Sencha User
    Join Date
    Sep 2015
    Location
    Banglore
    Posts
    2

    Default Where to put this code?

    Where to put this code? If i put in app.js or application.js, while building I am getting "Override target not found". What would be the solution?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •