From: erickson Date: Thu, 27 May 2010 16:04:44 +0000 (+0000) Subject: repaired bug in dojo.mixin usage for applying overrides. support for stying fields... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7deee3f73aaf0b3b67d6365ae6a7a6ac354d9c69;p=evergreen%2Fbjwebb.git repaired bug in dojo.mixin usage for applying overrides. support for stying fields marked readOnly via override git-svn-id: svn://svn.open-ils.org/ILS/trunk@16518 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/openils/widget/EditPane.js b/Open-ILS/web/js/dojo/openils/widget/EditPane.js index 760eca80d..69b005b38 100644 --- a/Open-ILS/web/js/dojo/openils/widget/EditPane.js +++ b/Open-ILS/web/js/dojo/openils/widget/EditPane.js @@ -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;