Author: jmorliaguet Date: Sat Mar 4 01:52:36 2006 New Revision: 2520 Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Log:
- rollback until there is a better method for managing observers 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 Sat Mar 4 01:52:36 2006 @@ -287,7 +287,8 @@ var evt_id = "registered controller " + c; CPSSkins.registerEventHandler(evt_id, view, function(event) { var controller = event.publisher; - controller.observe(view); + controller.views.add(id); + controller.register(view); CPSSkins.unsubscribe(evt_id); }); CPSSkins.subscribe(evt_id, {'subscriber': view}); @@ -371,22 +372,14 @@ this.views = new CPSSkins.Set(); }, - getId: function() { - return this.def.id; - }, - setup: function() { /* to override */ }, register: function(view) { /* to override */ - }, - - observe: function(view) { - this.views.add(view.getId()); - this.register(view); } + } CPSSkins.registerControllers({ @@ -975,10 +968,6 @@ this.storage = this._setStorageAdapter(); }, - getId: function() { - return this.def.id; - }, - // low-level I/O readData: function() { return this._data || this.def.data; @@ -1015,15 +1004,12 @@ var data = event.publisher.readData(); event.subscriber.display(data); }); - CPSSkins.subscribe('changed', - {'subscriber': view.getId(), 'publisher': this.getId()} - ); + CPSSkins.subscribe('changed', {'subscriber': view, 'publisher': model}); }, removeObserver: function(view) { - CPSSkins.unsubscribe('changed', - {'subscriber': view.getId(), 'publisher': this.getId()} - ); + var model = this; + CPSSkins.unsubscribe('changed', {'subscriber': view, 'publisher': model}); }, /* Private API */ @@ -1336,10 +1322,6 @@ this.setup(); }, - getId: function() { - return this.def.id; - }, - /* Public API */ inspect: function() { return "[CPSSkins " + this.def.widget + "]"; -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins