PDA

View Full Version : [CLOSED][3.0RC1.1] Panel's (and subclasses) shadowOffset default config never set



MD
7 May 2009, 12:21 PM
The shadowOffset config default value of Panel and its subclasses is never set in source (API docs note a default value of 4).

aconran
12 May 2009, 9:57 AM
This is not a bug.

Ext uses an Ext.Layer to create it's Ext.Panel. Panel shadowOffset does not need to set a default because it will come from Layer.

code in Panel when creating the layer...


makeFloating : function(cfg){
this.floating = true;
this.el = new Ext.Layer(
Ext.isObject(cfg) ? cfg : {
shadow: this.shadow !== undefined ? this.shadow : 'sides',
shadowOffset: this.shadowOffset,
constrain:false,
shim: this.shim === false ? false : undefined
}, this.el
);
}


shadowOffset at this point is undefined unless you have configured a default...

Relevant code within the Layer constructor:


if(config.shadow){
this.shadowOffset = config.shadowOffset || 4;
this.shadow = new Ext.Shadow({
offset : this.shadowOffset,
mode : config.shadow
});