Author: reebalazs
Date: Wed Jun 20 13:44:00 2007
New Revision: 44389
Modified:
kukit/kukit.js/trunk/kukit/dom.js
Log:
Extend setAttribute action to handle setting checked.
This needs to be converted to boolean and set directly on the node as a
property, otherwise it does not work.
Modified: kukit/kukit.js/trunk/kukit/dom.js
==============================================================================
--- kukit/kukit.js/trunk/kukit/dom.js (original)
+++ kukit/kukit.js/trunk/kukit/dom.js Wed Jun 20 13:44:00 2007
@@ -241,7 +241,7 @@
if (attrname.toLowerCase() == 'style') {
throw 'Style attribute is not allowed with setAttribute';
}
- if (attrname.toLowerCase() == 'class') {
+ else if (attrname.toLowerCase() == 'class') {
// The class attribute cannot be set on IE, instead
// className must be used. However node.className = x
// works on both IE and FF.
@@ -250,6 +250,10 @@
// On IE, workaround is needed. Since I am not sure, I use both
methods.
node.htmlFor = value;
node.setAttribute(attrname, value);
+ } else if (attrname.toLowerCase() == 'checked') {
+ // we need to convert this to boolean.
+ value = ! (value == '' || value == 'false' || value == 'False');
+ node.checked = value;
} else {
node.setAttribute(attrname, value);
}
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins