SWF-703 - Spring.ElementDecoration should properly copy any style class or inline style from the decorated node.

This commit is contained in:
Jeremy Grelle
2008-05-23 22:25:19 +00:00
parent 7ce695cd17
commit f2127f1450
2 changed files with 5 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@@ -25,7 +25,7 @@ dojo.declare("Spring.DefaultEquals", null, {
dojo.declare("Spring.ElementDecoration", [Spring.AbstractElementDecoration, Spring.DefaultEquals], {
constructor : function(config) {
this.copyFields = new Array('name', 'value', 'type', 'checked', 'selected', 'readOnly', 'disabled', 'alt', 'maxLength');
this.copyFields = new Array('name', 'value', 'type', 'checked', 'selected', 'readOnly', 'disabled', 'alt', 'maxLength', 'class');
dojo.mixin(this, config);
if(this.widgetModule == "") {
this.widgetModule = this.widgetType;
@@ -49,6 +49,9 @@ dojo.declare("Spring.ElementDecoration", [Spring.AbstractElementDecoration, Spri
this.widgetAttrs[copyField] = element[copyField];
}
}
if(element['style'] && element['style'].cssText){
this.widgetAttrs['style'] = element['style'].cssText;
}
dojo.require(this.widgetModule);
var widgetConstructor = dojo.eval(this.widgetType);
this.widget = new widgetConstructor(this.widgetAttrs, element);