[gatein-commits] gatein SVN: r4185 - portal/branches/branch-r4047/web/eXoResources/src/main/webapp/javascript/eXo/gadget.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Sep 14 06:19:35 EDT 2010
Author: kien_nguyen
Date: 2010-09-14 06:19:35 -0400 (Tue, 14 Sep 2010)
New Revision: 4185
Modified:
portal/branches/branch-r4047/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
Log:
GTNPORTAL-1458 Gadgets UserPrefs bool type doesnot render a checkbox
Modified: portal/branches/branch-r4047/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
===================================================================
--- portal/branches/branch-r4047/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js 2010-09-14 08:29:04 UTC (rev 4184)
+++ portal/branches/branch-r4047/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js 2010-09-14 10:19:35 UTC (rev 4185)
@@ -669,6 +669,19 @@
}
attEl.appendChild(el);
}
+ else if (type == "bool") {
+ var el = document.createElement("input");
+ el.type = "checkbox";
+ el.name = prefix + att;
+ el.id = elID;
+ if (userPrefs[att] && userPrefs[att] == "true") {
+ el.checked = userPrefs[att];
+ } else {
+ if(prefs[att].default == "true")
+ el.checked = true;
+ }
+ attEl.appendChild(el);
+ }
formEl.appendChild(attEl);
j++;
}
@@ -745,6 +758,8 @@
var userPrefNamePrefix = 'm_' + this.id + '_up_';
var userPrefName = input.name.substring(userPrefNamePrefix.length);
var userPrefValue = input.value;
+ if(input.type == 'checkbox')
+ userPrefValue = input.checked ? "true" : "false";
prefs[userPrefName] = userPrefValue;
}
}
More information about the gatein-commits
mailing list