diff options
| author | Romain Derie <rde@odoo.com> | 2020-01-10 10:28:15 +0000 |
|---|---|---|
| committer | Romain Derie <rde@odoo.com> | 2020-01-13 12:05:27 +0000 |
| commit | 5476a4c0edf896d6eb9c62bf54bd41a514a18d3b (patch) | |
| tree | 582c83ce4400f33acc4b6a43307b84c6fd75ce19 | |
| parent | 39c00a28df1dad4a4b02653c66a2f72d9cc55e06 (diff) | |
[FIX] web_editor: restore 'title' attribute on 'we' element
Since a refactoring (it was working at some point), `title` attribute on `we`
elements would be lost when rendering actual DOM elements.
We had 2 occurences of `title` on `we` elements:
1. s_countdown > What Should Happ.. > Show Message > fa-eye icon has a title
(in next version 13.2)
2. data-js `BackgroundPosition` (section) > fa-arrows has a title
Also, incoming Cookies Bar task/PR will add a title on 'Hide For' option.
closes odoo/odoo#43199
X-original-commit: 230a84edcea139bc7df44a4d1a27761e74038257
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
| -rw-r--r-- | addons/web_editor/static/src/js/editor/snippets.options.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index c199eaa40e3..86a3f70ac2b 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -21,14 +21,19 @@ var _t = core._t; * @returns {HTMLElement} - the original 'el' argument */ function _addTitleAndAllowedAttributes(el, title, options) { + let tooltipEl = el; if (title) { const titleEl = _buildTitleElement(title); + tooltipEl = titleEl; el.appendChild(titleEl); } if (options && options.classes) { el.classList.add(...options.classes); } + if (options && options.tooltip) { + tooltipEl.title = options.tooltip; + } if (options && options.dataAttributes) { for (const key in options.dataAttributes) { el.dataset[key] = options.dataAttributes[key]; @@ -1854,6 +1859,7 @@ const SnippetOptionWidget = Widget.extend({ options: { classes: el.classList, dataAttributes: el.dataset, + tooltip: el.title, childNodes: [...el.childNodes], }, }; |
