Results 1 to 3 of 3

Thread: Events and 'before' option

Hybrid View

Previous Post Previous Post   Next Post Next Post
    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1292 in a recent build.
  1. #1
    Sencha User demongloom's Avatar
    Join Date
    Apr 2008
    Location
    Israel
    Posts
    42
    Vote Rating
    3
      0  

    Default Events and 'before' option

    Hello,

    I've found bug which happens when I have multiple listeners for the same event. There are reproduce steps to simulate it.

    Code:
    // Initializing our test callbacks
    var test = { fn: function() { console.log('hi'); }, scope: {}, opts: {} };
    var test_before = { fn: function() { console.log('before hi'); }, scope: {}, opts: {} };
    
    
    // Binding first callback
    Ext.getBody().on('click', test.fn, test.scope, test.opts);
    
    
    
    
    
    
    //
    // clicking on the body -> 'hi'
    //
    
    
    
    
    // Binding 'before' callback
    Ext.getBody().on('click', test_before.fn, test_before.scope, test_before.opts, 'before');
    
    
    
    
    //
    // clicking on the body -> 'before hi', 'hi'
    //
    
    
    
    
    
    
    // Unbinding 'before' callback
    Ext.getBody().un('click', test_before.fn, test_before.scope, test_before.opts, 'before');
    
    
    
    
    //
    // clicking on the body -> nothing happens !!!
    //
    
    
    
    
    
    // Binding 'before' callback
    Ext.getBody().on('click', test_before.fn, test_before.scope, test_before.opts, 'before');
    
    
    
    
    //
    // clicking on the body -> 'before hi', 'hi'
    //
    Using debugger I found the problem inside Ext.event.publisher.Dom.unsubscribe function. It's don't take into attention event ordering parameters, so when 'before' event is detached it's also affects on regular events.


  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    Thank you for the report.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

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

    Default

    This has been fixed for the next release.

    Sencha Inc

    Jamie Avins

    @jamieavins

Posting Permissions

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