summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic
diff options
context:
space:
mode:
authorRomeo Fragomeli <rfr@odoo.com>2020-05-28 11:03:05 +0000
committerRomeo Fragomeli <rfr@odoo.com>2020-05-29 13:31:31 +0000
commit16fabc82277a5ff77271a17078865d0c7ea4bf70 (patch)
tree10401f8fd71f7bfdbe7c4963783145f84f1c7a51 /addons/web/static/src/js/views/basic
parentba93b4a24391f6060cd9a3c9a1a64a1a00459803 (diff)
[REF] web: allow override tooltip options
Before this commit, the options of the tooltip where set inline. After this commit, the options are returned by a function. This allow us to adapt these options in another module. Task ID: 2152124 closes odoo/odoo#52170 Related: odoo/enterprise#10864 Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic')
-rw-r--r--addons/web/static/src/js/views/basic/basic_renderer.js25
1 files changed, 17 insertions, 8 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_renderer.js b/addons/web/static/src/js/views/basic/basic_renderer.js
index 3d5c14e0b10..322b284a742 100644
--- a/addons/web/static/src/js/views/basic/basic_renderer.js
+++ b/addons/web/static/src/js/views/basic/basic_renderer.js
@@ -280,14 +280,7 @@ var BasicRenderer = AbstractRenderer.extend(WidgetAdapterMixin, {
// should be attached if not given, the tooltip is attached on the
// widget's $el
$node = $node.length ? $node : widget.$el;
- $node.tooltip({
- title: function () {
- return qweb.render('WidgetLabel.tooltip', {
- debug: config.isDebug(),
- widget: widget,
- });
- }
- });
+ $node.tooltip(this._getTooltipOptions(widget));
},
/**
* Does the necessary DOM updates to match the given modifiers data. The
@@ -414,6 +407,22 @@ var BasicRenderer = AbstractRenderer.extend(WidgetAdapterMixin, {
return null;
},
/**
+ * Get the options for the tooltip. This allow to change this options in another module.
+ * @param widget
+ * @return {{}}
+ * @private
+ */
+ _getTooltipOptions: function (widget) {
+ return {
+ title: function () {
+ return qweb.render('WidgetLabel.tooltip', {
+ debug: config.isDebug(),
+ widget: widget,
+ });
+ }
+ };
+ },
+ /**
* @private
* @param {jQueryElement} $el
* @param {Object} node