Author: jmorliaguet
Date: Mon Feb 27 19:52:38 2006
New Revision: 2494

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

- fixes



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 Mon Feb 27 
19:52:38 2006
@@ -46,6 +46,8 @@
   _controllers: $H({}),
   _handlers: $H({}),
 
+  _count: 0,
+
   init: function() {
     CPSSkins._parse(document);
   },
@@ -178,7 +180,7 @@
       }
     });
 
-    elements.each(function(el, index) {
+    elements.each(function(el) {
       var url = el.getAttribute("cite");
       if (url) {
         var options = {
@@ -204,9 +206,10 @@
   _load: function(node) {
     var elements = $A(node.getElementsByTagName("ins"));
     ["view", "controller", "model"].each(function(type) {
-      elements.each(function(el, index) {
+      elements.each(function(el) {
         if (Element.hasClassName(el, type)) {
-          CPSSkins._register(el, type, index);
+          CPSSkins._register(el, type, CPSSkins._count);
+          CPSSkins._count += 1;
         }
       });
     });
@@ -557,7 +560,7 @@
   },
 
   switchTo: function(perspective) {
-    var to_show = this._visible_views[perspective];
+    var to_show = this._visible_views[perspective] || [];
     var to_hide = this.views.select(function(el) {
       return to_show.indexOf(el) < 0;
     });
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to