summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/content/context.js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2019-02-04 14:45:16 +0000
committerqsm-odoo <qsm@odoo.com>2019-02-05 11:39:11 +0000
commitb6db6b878c5d329c19262d829e13726c3a3a1d25 (patch)
treefd49fff13e186b91f88b287a99e114adaa8a406d /addons/website/static/src/js/content/context.js
parent99499589eafb9c05236eb47553c1d723573c1b70 (diff)
[REF] website, *: remove 'website.context' module
* website_forum, website_gengo, website_mail_channel, website_sale Retrieving the global context is now the root's job, this will prevent problems when trying to extend the values the context has. See upcoming improvements with https://github.com/odoo/odoo/pull/29442 closes odoo/odoo#30816
Diffstat (limited to 'addons/website/static/src/js/content/context.js')
-rw-r--r--addons/website/static/src/js/content/context.js25
1 files changed, 0 insertions, 25 deletions
diff --git a/addons/website/static/src/js/content/context.js b/addons/website/static/src/js/content/context.js
deleted file mode 100644
index 671ad345e65..00000000000
--- a/addons/website/static/src/js/content/context.js
+++ /dev/null
@@ -1,25 +0,0 @@
-odoo.define('website.context', function (require) {
-'use strict';
-
-function getContext(context) {
- var html = document.documentElement;
- return _.extend({
- lang: (html.getAttribute('lang') || 'en_US').replace('-', '_'),
- website_id: html.getAttribute('data-website-id') | 0,
- }, context || {});
-}
-
-function getExtraContext(context) {
- var html = document.documentElement;
- return _.extend(getContext(), {
- editable: !!(html.dataset.editable || $('[data-oe-model]').length), // temporary hack, this should be done in python
- translatable: !!html.dataset.translatable,
- edit_translations: !!html.dataset.edit_translations,
- }, context || {});
-}
-
-return {
- get: getContext,
- getExtra: getExtraContext,
-};
-});