Author: jmorliaguet
Date: Sun Feb 26 14:37:35 2006
New Revision: 2478

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/ctal.js
Log:

- fix for IE and optimizations (tmpl.attributes is extremely costly under IE
  since all node attributes even those that are not in the HTML are listed)



Modified: cpsskins/branches/jmo-perspectives/ui/framework/ctal.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/ctal.js     (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/ctal.js     Sun Feb 26 
14:37:35 2006
@@ -182,26 +182,21 @@
 
 ctal.process_ctal = function(tmpl, data) {
   var recurse = true;
+  var parsers, ctal_attr, ctal_attr_name, attr;
   if (tmpl.nodeType == 1) {
-    var parsers = ctal.parsers;
+    parsers = ctal.parsers;
     for (ctal_attr in parsers) {
-      var attrs = tmpl.attributes;
-      for (i=0; i<attrs.length; i++) {
-        var attrnode = attrs[i];
-        var attrname = attrnode.nodeName;
-        if (attrname != "ctal:" + ctal_attr) {
-          continue;
-        }
-        tmpl.removeAttribute("ctal:" + ctal_attr);
+      ctal_attr_name = "ctal:" + ctal_attr;
+      attr = tmpl.getAttribute(ctal_attr_name);
+      if (attr != null) {
+        tmpl.removeAttribute(ctal_attr_name);
         // For Opera
         tmpl.removeAttribute(ctal_attr);
-
         var parser = parsers[ctal_attr];
         if (!parser.recurse) {
           recurse = false;
         }
-        parser.parse(tmpl, attrnode.value, data)
-        break;
+        parser.parse(tmpl, attr, data)
       }
     }
   }
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to