PDA

View Full Version : [FIXED] [4.1.x] fadeOut, fadeIn, etc not safe to use with flyweights



mankz
14 Nov 2012, 1:31 AM
These methods should not save reference to 'this', since that prevents doing


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).


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;
},

mitchellsimoens
14 Nov 2012, 6:30 AM
Hey, thanks for the report!

mpost
11 Feb 2014, 6:02 PM
In what released version is this fixed? I'm unable to see the bug database. :((

mankz
12 Feb 2014, 9:32 PM
4.2.2 looks good:



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;
},