Author: mwringe
Date: 2011-11-21 12:27:37 -0500 (Mon, 21 Nov 2011)
New Revision: 8106
Modified:
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
Log:
JBEPP-1383: fix issue where default values for gadget preferences were not being used.
Modified:
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js 2011-11-21
16:02:30 UTC (rev 8105)
+++
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js 2011-11-21
17:27:37 UTC (rev 8106)
@@ -653,8 +653,12 @@
theText = document.createTextNode(value.displayValue);
optEl.appendChild(theText);
optEl.setAttribute("value", value.value);
- if(userValue && value.value == userValue)
- optEl.setAttribute("selected", "selected");
+ if(userValue && value.value == userValue) {
+ optEl.setAttribute("selected", "selected");
+ }
+ else if (prefs[att].defaultValue && value.value ==
prefs[att].defaultValue) {
+ optEl.setAttribute("selected", "selected");
+ }
el.appendChild(optEl);
}
el.id = elID;
@@ -667,6 +671,9 @@
if (userPrefs[att]) {
el.value = userPrefs[att];
}
+ else if (prefs[att].defaultValue) {
+ el.value = prefs[att].defaultValue;
+ }
attEl.appendChild(el);
}
else if (type == "bool") {
@@ -678,6 +685,9 @@
prefs[att]["default"] == "true") {
el.checked = true;
}
+ else {
+ el.checked = prefs[att].defaultValue;
+ }
attEl.appendChild(el);
}
formEl.appendChild(attEl);
Show replies by date