Author: jmorliaguet
Date: Wed Mar  1 21:48:22 2006
New Revision: 2502

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

- fixed page initialization error (a local variable was being used for counting
  initialized elements)



Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Wed Mar  1 
21:48:22 2006
@@ -46,7 +46,8 @@
   _controllers: $H({}),
   _handlers: $H({}),
 
-  _count: 0,
+  _loaded: 0,
+  _initialized: 0,
 
   init: function() {
     CPSSkins._parse(document);
@@ -168,17 +169,18 @@
   // first stage
   _parse: function(node) {
     var elements = $A(node.getElementsByTagName("ins"));
-    var progress = {'initialized': 0};
+    CPSSkins._initialized = 0;
     var length = elements.length;
+    var progress = new Object();
 
-    CPSSkins.subscribe("initialized", {'subscriber': progress});
     CPSSkins.registerEventHandler("initialized", progress, function(event) {
-      progress.initialized += 1;
-      if (progress.initialized >= length) {
+      CPSSkins._initialized += 1;
+      if (CPSSkins._initialized >= length) {
         CPSSkins._load(node);
         CPSSkins.unsubscribe("initialized");
       }
     });
+    CPSSkins.subscribe("initialized", {'subscriber': progress});
 
     elements.each(function(el) {
       var url = el.getAttribute("cite");
@@ -208,8 +210,8 @@
     ["view", "controller", "model"].each(function(type) {
       elements.each(function(el) {
         if (Element.hasClassName(el, type)) {
-          CPSSkins._register(el, type, CPSSkins._count);
-          CPSSkins._count += 1;
+          CPSSkins._register(el, type, CPSSkins._loaded);
+          CPSSkins._loaded += 1;
         }
       });
     });
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to