myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r1451580 - in /myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util: _Dom.js _DomQuirks.js
Date Fri, 01 Mar 2013 12:55:05 GMT
Author: werpu
Date: Fri Mar  1 12:55:04 2013
New Revision: 1451580

URL: http://svn.apache.org/r1451580
Log:
MYFACES-3699 MYFACES-3700

Modified:
    myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js
    myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js?rev=1451580&r1=1451579&r2=1451580&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js
(original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js
Fri Mar  1 12:55:04 2013
@@ -1026,7 +1026,16 @@ _MF_SINGLTN(_PFX_UTIL + "_Dom", Object, 
         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);
+        }
     },
 
     /**

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js?rev=1451580&r1=1451579&r2=1451580&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js
(original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js
Fri Mar  1 12:55:04 2013
@@ -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



Mime
View raw message