Results 1 to 4 of 4

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

    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,153

    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 Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

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

    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,153

    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
  •