Skip to content
Browse files

MYFACES-3699 MYFACES-3700

git-svn-id: https://svn.apache.org/repos/asf/myfaces/core/trunk@1451580 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 44b1aae commit 8bf5b132d1e27a914626925b121a037a89bb92a0 @weblets weblets committed Mar 1, 2013
View
11 api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js
@@ -1026,7 +1026,16 @@ _MF_SINGLTN(_PFX_UTIL + "_Dom", Object, /** @lends myfaces._impl._util._Dom.prot
if (!node.setAttribute) {
return;
}
- node.setAttribute(attr, val);
+
+ if (attr === 'disabled') {
+ node.disabled = val === 'disabled' || val === 'true';
+ } else if (attr === 'checked') {
+ node.checked = val === 'checked' || val === 'on' || val === 'true';
+ } else if (attr == 'readonly') {
+ node.readOnly = val === 'readonly' || val === 'true';
+ } else {
+ node.setAttribute(attr, val);
+ }
},
/**
View
13 api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js
@@ -468,12 +468,13 @@ if (_MF_SINGLTN) {
//ie supported events
if (this.IE_QUIRKS_EVENTS[attr]) {
if (this._Lang.isString(attr)) {
- //event resolves to window.event in ie
- var _t = this;
- node.setAttribute(attr, function () {
- //event implicitly used
- return _t._Lang.globalEval(val);
- });
+ var c = document.body.appendChild(document.createElement('span'));
+ try {
+ c.innerHTML = '<span ' + attr + '="' + val + '"/>';
+ node[attr] = c.firstChild[attr];
+ } finally {
+ document.body.removeChild(c);
+ }
}
} else {
//unknown cases we try to catch them via standard setAttributes

0 comments on commit 8bf5b13

Please sign in to comment.
Something went wrong with that request. Please try again.