diff options
| author | niv-openerp <nicolas.vanhoren@openerp.com> | 2013-07-26 14:48:37 +0200 |
|---|---|---|
| committer | niv-openerp <nicolas.vanhoren@openerp.com> | 2013-07-26 14:48:37 +0200 |
| commit | c94c4599b2a1e76664db8558bcd973ac6250e18f (patch) | |
| tree | 40bb5dd81125ea6a29e89328ced0ebde3cc2b9e5 /addons/web/static/src/js/corelib.js | |
| parent | 99e07f1e3e99c633702b9e10dabce5334098d47e (diff) | |
Moved proxy()
bzr revid: nicolas.vanhoren@openerp.com-20130726124837-yze64evp7r70uv5y
Diffstat (limited to 'addons/web/static/src/js/corelib.js')
| -rw-r--r-- | addons/web/static/src/js/corelib.js | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js index 1b93ced09aa..c419685c222 100644 --- a/addons/web/static/src/js/corelib.js +++ b/addons/web/static/src/js/corelib.js @@ -27,32 +27,6 @@ openerp.web.corelib = function(instance) { var ControllerMixin = { /** - * Proxies a method of the object, in order to keep the right ``this`` on - * method invocations. - * - * This method is similar to ``Function.prototype.bind`` or ``_.bind``, and - * even more so to ``jQuery.proxy`` with a fundamental difference: its - * resolution of the method being called is lazy, meaning it will use the - * method as it is when the proxy is called, not when the proxy is created. - * - * Other methods will fix the bound method to what it is when creating the - * binding/proxy, which is fine in most javascript code but problematic in - * OpenERP Web where developers may want to replace existing callbacks with - * theirs. - * - * The semantics of this precisely replace closing over the method call. - * - * @param {String|Function} method function or name of the method to invoke - * @returns {Function} proxied method - */ - proxy: function (method) { - var self = this; - return function () { - var fn = (typeof method === 'string') ? self[method] : method; - return fn.apply(self, arguments); - }; - }, - /** * Informs the action manager to do an action. This supposes that * the action manager can be found amongst the ancestors of the current widget. * If that's not the case this method will simply return `false`. |
