Author: jmorliaguet
Date: Fri Feb 17 12:19:59 2006
New Revision: 2396

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

- harmonization: rename the event 'info' object as 'event'



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 Fri Feb 17 
12:19:59 2006
@@ -106,18 +106,18 @@
     CPSSkins.Subscribers[eventid] = new_subscribers;
   },
 
-  notify: function(eventid, info) {
+  notify: function(eventid, event) {
     var subscribers = CPSSkins.Subscribers[eventid];
-    var publisher = info.publisher;
+    var publisher = event.publisher;
     $A(subscribers).each(function(e) {
       var event_publisher = e.publisher;
       if (event_publisher == publisher || event_publisher == null) {
         var handler = CPSSkins.getEventHandler(eventid, e.subscriber);
         if (handler) {
           // set the publisher in case no publisher is specified in the 
subscription.
-          info.subscriber = e.subscriber;
-          info.publisher = publisher;
-          handler(info);
+          event.subscriber = e.subscriber;
+          event.publisher = publisher;
+          handler(event);
         }
       }
     });
@@ -419,21 +419,21 @@
 
     var controller = this;
 
-    CPSSkins.registerEventHandler("command", controller, function(info) {
-      var view = info.subscriber;
-      var controller = info.publisher;
+    CPSSkins.registerEventHandler("command", controller, function(event) {
+      var view = event.subscriber;
+      var controller = event.publisher;
 
       // add some contextual info
-      info.view = view;
-      info.model = view.model;
+      event.view = view;
+      event.model = view.model;
 
-      var action = info.options.action;
+      var action = event.options.action;
       // TODO: to refactor
       /* the event handler calls the controller's registered handler */
       var handler_id = controller.def.handlers[action];
       if (handler_id) {
         var handler = CPSSkins.Handlers[handler_id];
-        if (handler) handler(info);
+        if (handler) handler(event);
       }
     });
 
@@ -477,9 +477,9 @@
 
     var controller = this;
 
-    CPSSkins.registerEventHandler("gained focus", controller, function(info) {
-      var view = info.publisher;
-      var selected = info.context;
+    CPSSkins.registerEventHandler("gained focus", controller, function(event) {
+      var view = event.publisher;
+      var selected = event.context;
       if (!view.def.model) {
         var model = Canvas.getModel(selected);
         if (model) {
@@ -488,8 +488,8 @@
       }
     });
 
-    CPSSkins.registerEventHandler("lost focus", controller, function(info) {
-      var view = info.publisher;
+    CPSSkins.registerEventHandler("lost focus", controller, function(event) {
+      var view = event.publisher;
       view.stopObserving();
     });
 
@@ -1644,12 +1644,12 @@
       if (!window.confirm(confirm)) return;
     }
     /* notify the controller to take action */
-    var info = {
+    var event = {
       "context": this.selected,
       "publisher": this.controller,
       "options": {'action': action, 'choice': choice}
     }
-    CPSSkins.notify("command", info);
+    CPSSkins.notify("command", event);
     this.active = false;
   },
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to