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;
}
}
Show replies by date