papasi
13 Mar 2007, 10:37 AM
Hi,
This is minor issue but fixing it makes it a lot more convenient to chain Element's method call like
Ext.get("error").setWidth(300).anchorTo('dialog', 'b-b').hide().show();
Here's a simple patch:
anchorTo : function(el, alignment, offsets, animate, monitorScroll){
var action = function(){
this.alignTo(el, alignment, offsets, animate);
};
Ext.EventManager.onWindowResize(action, this);
var tm = typeof monitorScroll;
if(tm != 'undefined'){
Ext.EventManager.on(window, 'scroll', action, this,
{buffer: tm == 'number' ? monitorScroll : 50});
}
action.call(this); // align immediately
},
anchorTo : function(el, alignment, offsets, animate, monitorScroll){
var action = function(){
return this.alignTo(el, alignment, offsets, animate);
};
Ext.EventManager.onWindowResize(action, this);
var tm = typeof monitorScroll;
if(tm != 'undefined'){
Ext.EventManager.on(window, 'scroll', action, this,
{buffer: tm == 'number' ? monitorScroll : 50});
}
return action.call(this); // align immediately
},
Thanks
This is minor issue but fixing it makes it a lot more convenient to chain Element's method call like
Ext.get("error").setWidth(300).anchorTo('dialog', 'b-b').hide().show();
Here's a simple patch:
anchorTo : function(el, alignment, offsets, animate, monitorScroll){
var action = function(){
this.alignTo(el, alignment, offsets, animate);
};
Ext.EventManager.onWindowResize(action, this);
var tm = typeof monitorScroll;
if(tm != 'undefined'){
Ext.EventManager.on(window, 'scroll', action, this,
{buffer: tm == 'number' ? monitorScroll : 50});
}
action.call(this); // align immediately
},
anchorTo : function(el, alignment, offsets, animate, monitorScroll){
var action = function(){
return this.alignTo(el, alignment, offsets, animate);
};
Ext.EventManager.onWindowResize(action, this);
var tm = typeof monitorScroll;
if(tm != 'undefined'){
Ext.EventManager.on(window, 'scroll', action, this,
{buffer: tm == 'number' ? monitorScroll : 50});
}
return action.call(this); // align immediately
},
Thanks