diff options
| author | Jiten (OpenERP) <jra@tinyerp.com> | 2011-09-22 15:46:17 +0530 |
|---|---|---|
| committer | Jiten (OpenERP) <jra@tinyerp.com> | 2011-09-22 15:46:17 +0530 |
| commit | dbe1e67f9274e58a1a4eec4295ade68558ab40a2 (patch) | |
| tree | a2debbf5f5c31c7666560cb04b95f7e1ee20c131 /addons/web/static/src/js/core.js | |
| parent | 27e6b96bb5871129862b2d9fbbcfffdc7df800b9 (diff) | |
| parent | 60d9065ff1d0115be69440cdc44543ddceab81a9 (diff) | |
[MERGE] Merge from openerp-web.
bzr revid: jra@tinyerp.com-20110922101617-u1gz39qnnopj016r
Diffstat (limited to 'addons/web/static/src/js/core.js')
| -rw-r--r-- | addons/web/static/src/js/core.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index a33fca458d0..2e9294ded12 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -1,7 +1,10 @@ /*--------------------------------------------------------- * OpenERP Web core *--------------------------------------------------------*/ - +var console; +if (!console) { + console = {log: function () {}}; +} if (!console.debug) { console.debug = console.log; } @@ -483,7 +486,8 @@ openerp.web.Session = openerp.web.CallbackEnabled.extend( /** @lends openerp.web self.user_context = result.context; self.db = result.db; self.session_save(); - self.on_session_valid(); + if (self.uid) + self.on_session_valid(); return true; }).then(success_callback); }, @@ -771,7 +775,6 @@ openerp.web.SessionAware = openerp.web.CallbackEnabled.extend(/** @lends openerp * // stuff that you want to init before the rendering * }, * start: function() { - * this._super(); * // stuff you want to make after the rendering, `this.$element` holds a correct value * this.$element.find(".my_button").click(/* an example of event binding * /); * @@ -915,6 +918,8 @@ openerp.web.Widget = openerp.web.SessionAware.extend(/** @lends openerp.web.Widg * @returns {jQuery.Deferred} */ start: function() { + /* The default implementation is only useful for retro-compatibility, it is + not necessary to call it using _super() when using Widget for new components. */ if (!this.$element) { var tmp = document.getElementById(this.element_id); this.$element = tmp ? $(tmp) : undefined; @@ -922,7 +927,7 @@ openerp.web.Widget = openerp.web.SessionAware.extend(/** @lends openerp.web.Widg return $.Deferred().done().promise(); }, /** - * Destroys the current widget, also destory all its children before destroying itself. + * Destroys the current widget, also destroy all its children before destroying itself. */ stop: function() { _.each(_.clone(this.widget_children), function(el) { @@ -943,7 +948,6 @@ openerp.web.Widget = openerp.web.SessionAware.extend(/** @lends openerp.web.Widg * If that's not the case this method will simply return `false`. */ do_action: function(action, on_finished) { - console.log('Widget.do_action', action, on_finished); if (this.widget_parent) { return this.widget_parent.do_action(action, on_finished); } |
