Results 1 to 4 of 4

Thread: [4.1.x] fadeOut, fadeIn, etc not safe to use with flyweights

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 EXTJS-7756 in 4.2.0.265.
  1. #1
    Sencha Premium User mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    3,078
    Vote Rating
    184
      0  

    Default [4.1.x] fadeOut, fadeIn, etc not safe to use with flyweights

    These methods should not save reference to 'this', since that prevents doing

    Code:
    Ext.fly(someNode).fadeOut();
    If this is intended (hopefully it's not), docs should state this. You get very bizarre and hard to debug errors from this, as some random element on the page will just disappear (when fadeOut is complete).

    Code:
    fadeOut: function(o) {
            var me = this;
            o = Ext.apply({
                opacity: 0,
                internalListeners: {
                    afteranimate: function(anim){
                        var dom = me.dom;
                        if (dom && anim.to.opacity === 0) {
                            if (o.useDisplay) {
                                me.setDisplayed(false);
                            } else {
                                me.hide();
                            }
                        }         
                    }
                }
            }, o);
            me.animate(o);
            return me;
        },

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

    Default

    Hey, thanks 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
    Join Date
    Sep 2012
    Posts
    83
    Vote Rating
    6
      0  

    Default

    In what released version is this fixed? I'm unable to see the bug database.

  4. #4
    Sencha Premium User mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    3,078
    Vote Rating
    184
      0  

    Default

    4.2.2 looks good:

    Code:
    fadeOut: function(o) {
            var me = this,
                dom = me.dom;
                
            o = Ext.apply({
                opacity: 0,
                internalListeners: {
                    afteranimate: function(anim){
                        if (dom && anim.to.opacity === 0) {
                            var el = Ext.fly(dom, '_anim');
                            if (o.useDisplay) {
                                el.setDisplayed(false);
                            } else {
                                el.hide();
                            }
                        }         
                    }
                }
            }, o);
            me.animate(o);
            return me;
        },

Posting Permissions

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