Author: jmorliaguet
Date: Mon Jan 30 22:44:01 2006
New Revision: 2257

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

- simpler code using Javascript's 'delete'



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 30 
22:44:01 2006
@@ -589,8 +589,7 @@
   },
 
   addObserver: function(view) {
-    var view_id = view.id;
-    this.observers[view_id] = view;
+    this.observers[view.id] = view;
     // create a back-reference
     view.model = this;
     // initialize the view
@@ -598,15 +597,7 @@
   },
 
   removeObserver: function(view) {
-    var id = view.id;
-    var observers = $H({});
-    this.observers.each(function(v) {
-      var key = v[0];
-      if (key != id) {
-        observers[key] = v[1];
-      }
-    });
-    this.observers = observers;
+    delete this.observers[view.id];
   },
 
   notifyObservers: function(data) {
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to