Author: jmorliaguet Date: Tue Feb 7 10:40:19 2006 New Revision: 2315 Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Log:
- added a call method for the controller 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 Tue Feb 7 10:40:19 2006 @@ -356,6 +356,10 @@ setup: function() { /* to override */ + }, + + call: function() { + /* to override */ } } @@ -370,12 +374,18 @@ form: function(node, def) { return new CPSSkins.FormController(node, def); } + }); CPSSkins.CommandController = Class.create(); CPSSkins.CommandController.prototype = Object.extend(new CPSSkins.Controller(), { - setup: function() { + call: function(view, object, action, args) { + var handler_id = this.def.handlers[action]; + if (handler_id) { + var handler = CPSSkins.Handlers[handler_id]; + handler(view.model, object, args); + } } }); @@ -384,7 +394,6 @@ CPSSkins.FormController.prototype = Object.extend(new CPSSkins.Controller(), { setup: function() { - alert('setup'); } }); @@ -1020,11 +1029,8 @@ handleAction: function(object, action, args) { var controller = this.controller; if (!controller) return; - var handler_id = controller.def.handlers[action]; - if (handler_id) { - var handler = CPSSkins.Handlers[handler_id]; - handler(this.model, object, args); - } + var view = this; + controller.call(view, object, action, args); }, getData: function() { -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins