Author: jmorliaguet
Date: Mon Jan  9 23:03:26 2006
New Revision: 2201

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

- CPSSkins.notify(...) is now called view.handleAction(object, command, arg)



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 Jan  9 
23:03:26 2006
@@ -84,21 +84,6 @@
 
   /* Controller */
 
-  getController: function(tag) {
-    var controller = tag.getAttribute("controller");
-    return this.Controllers[controller];
-  },
-
-  notify: function(tag, object, action, param) {
-    var controller = this.getController(tag);
-    if (!controller) return;
-    var handler = controller.handlers[action];
-    if (handler) {
-      handler(object, param);
-    }
-  },
-
-  /* Perspectives */
 
   _resolvePerspective: function(perspective) {
     var path = CPSSkins.CurrentPerspective.split("/");
@@ -459,7 +444,12 @@
     this.widget = widget;
     this.tag = tag;
 
-    this.effects = (tag.getAttribute("effects") || "").split(",");
+    var controller_id = tag.getAttribute("controller") || null;
+    if (controller_id) {
+      this.controller = CPSSkins.Controllers[controller_id];
+    } else {
+      this.controller = null;
+    }
 
     var observed = tag.getAttribute("observe");
     if (observed) {
@@ -468,6 +458,8 @@
       this.observed = null;
     }
 
+    this.effects = (tag.getAttribute("effects") || "").split(",");
+
     this.setup();
   },
 
@@ -493,6 +485,16 @@
   },
 
   /* Private API */
+
+  handleAction: function(object, action, param) {
+    var controller = this.controller;
+    if (!controller) return;
+    var handler = controller.handlers[action];
+    if (handler) {
+      handler(object, param);
+    }
+  },
+
   getData: function() {
     if (this.observed) {
       return Canvas.getNodeData(this.observed);
@@ -872,7 +874,7 @@
       if (!window.confirm(confirm)) return;
     }
     /* notify the controller */
-    CPSSkins.notify(this.tag, this.selected, action, choice);
+    this.handleAction(this.selected, action, choice);
     this.active = false;
   },
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to