diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-08-27 16:44:17 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-08-27 16:44:17 +0200 |
| commit | 9947133361f4d6fc4c9cbb68e2e2230728fcdafd (patch) | |
| tree | 4fc266cd52f55d94f86d7df2ab75323e35fde99c /addons/website/static/src/js/content/website_root.js | |
| parent | f7ead5fd50f4b6db2a1d4c947fc4e15dceedbbd7 (diff) | |
| parent | 40430699dfbba715b143c109ebae415074da9f40 (diff) | |
[MERGE] forward port branch saas-11.5 up to 40430699dfb
Diffstat (limited to 'addons/website/static/src/js/content/website_root.js')
| -rw-r--r-- | addons/website/static/src/js/content/website_root.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/addons/website/static/src/js/content/website_root.js b/addons/website/static/src/js/content/website_root.js index a51c8011e92..b010c38f934 100644 --- a/addons/website/static/src/js/content/website_root.js +++ b/addons/website/static/src/js/content/website_root.js @@ -45,6 +45,7 @@ var WebsiteRoot = BodyManager.extend({ custom_events: _.extend({}, BodyManager.prototype.custom_events || {}, { animation_start_demand: '_onAnimationStartDemand', animation_stop_demand: '_onAnimationStopDemand', + main_object_request: '_onMainObjectRequest', ready_to_clean_for_save: '_onAnimationStopDemand', }), @@ -224,6 +225,20 @@ var WebsiteRoot = BodyManager.extend({ window.location.href = _.str.sprintf("/website/lang/%(lang)s?r=%(url)s%(hash)s", redirect); }, /** + * Checks information about the page main object. + * + * @private + * @param {OdooEvent} ev + */ + _onMainObjectRequest: function (ev) { + var repr = $('html').data('main-object'); + var m = repr.match(/(.+)\((\d+),(.*)\)/); + ev.data.callback({ + model: m[1], + id: m[2] | 0, + }); + }, + /** * @todo review * @private */ |
