[open-ils-commits] r17555 - trunk/Open-ILS/web/js/dojo/openils/widget (senator)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Sep 9 17:28:26 EDT 2010
Author: senator
Date: 2010-09-09 17:28:20 -0400 (Thu, 09 Sep 2010)
New Revision: 17555
Modified:
trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js
Log:
Improve on 17547 to support a default value for /creating/ new objects while
letting the current value of an object pass through to the overriding widget
when /editing/.
Modified: trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js 2010-09-09 21:09:26 UTC (rev 17554)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js 2010-09-09 21:28:20 UTC (rev 17555)
@@ -177,7 +177,10 @@
if(this.parentNode) // may already be in the "right" place
this.parentNode.appendChild(this.widget.domNode);
if (this.shove) {
- this.widget.attr("value", this.widgetValue);
+ if (this.shove.mode == "update")
+ this.widget.attr("value", this.widgetValue);
+ else
+ this.widgetValue = this.shove.create;
this._widgetLoaded();
} else if (this.widget.attr("value") == null) {
this._widgetLoaded();
Modified: trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js 2010-09-09 21:09:26 UTC (rev 17554)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js 2010-09-09 21:28:20 UTC (rev 17555)
@@ -126,9 +126,11 @@
);
if (this.overrideWidgets[field.name]) {
- if (this.overrideWidgets[field.name].shove &&
- this.mode == "update") {
- args.shove = true;
+ if (this.overrideWidgets[field.name].shove) {
+ args.shove = dojo.mixin(
+ {"mode": this.mode},
+ this.overrideWidgets[field.name].shove
+ );
}
}
More information about the open-ils-commits
mailing list