repaired bug in dojo.mixin usage for applying overrides. support for stying fields...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 27 May 2010 16:04:44 +0000 (16:04 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 27 May 2010 16:04:44 +0000 (16:04 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16518 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/widget/EditPane.js

index 760eca8..69b005b 100644 (file)
@@ -91,12 +91,6 @@ if(!dojo._hasResource['openils.widget.EditPane']) {
                     dojo.addClass(nameTd, 'openils-widget-editpane-name-cell');
                     dojo.addClass(valTd, 'openils-widget-editpane-value-cell');
 
-                    if(this.readOnly) {
-                        dojo.addClass(nameTd, 'openils-widget-editpane-ro-name-cell');
-                        dojo.addClass(valTd, 'openils-widget-editpane-ro-value-cell');
-                    }
-
-
                     /*
                     if(this.fieldDocs[field]) {
                         var helpLink = dojo.create('a');
@@ -117,7 +111,7 @@ if(!dojo._hasResource['openils.widget.EditPane']) {
                         this.overrideWidgetArgs[field.name] = {};
 
                     var args = dojo.mixin(
-                        this.overrideWidgetArgs[field.name], {
+                        {   // defaults
                             idlField : field, 
                             fmObject : this.fmObject,
                             fmClass : this.fmClass,
@@ -127,9 +121,15 @@ if(!dojo._hasResource['openils.widget.EditPane']) {
                             widget : this.overrideWidgets[field.name],
                             widgetClass : this.overrideWidgetClass[field.name],
                             disableWidgetTest : this.disableWidgetTest
-                        }
+                        },
+                        this.overrideWidgetArgs[field.name] // per-field overrides
                     );
 
+                    if(args.readOnly) {
+                        dojo.addClass(nameTd, 'openils-widget-editpane-ro-name-cell');
+                        dojo.addClass(valTd, 'openils-widget-editpane-ro-value-cell');
+                    }
+
                     if(this.requiredFields && this.requiredFields.indexOf(field.name) >= 0) {
                         if(!args.dijitArgs) args.dijitArgs = {};
                         args.dijitArgs.required = true;