summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/content/website_root.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/website/static/src/js/content/website_root.js')
-rw-r--r--addons/website/static/src/js/content/website_root.js15
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
*/