diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2019-04-05 14:34:03 +0000 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2019-04-08 08:17:57 +0000 |
| commit | e1b1d3cd1bf703e175ad188333e868977e34dccd (patch) | |
| tree | 4d8398694c392d3a41a504cd7243f43d8fa1afb3 /addons/web_editor/static/src | |
| parent | 610ab82b51937beccdc3e69dc55b6f843047cae5 (diff) | |
[FIX] web_editor: no lose tooltip on selection
The editor has a tooltip editor wizard "Change media description and
tooltip", but when selecting an image there is also a tooltip:
"Double-click to edit"
added by the editor.
The combination of the two break the functionality, eg:
- if a tooltip is set with editor, then selecting the tooltip: we see
the set tooltip and not "Double-click to edit"
- if a tooltip is set with editor, then selecting the image back, then
opening the tooltip editor => the set tooltip is lost
With this changeset, we just do not show "Double-click to edit" tooltip
if there is a tooltip set on the element.
opw-1946801
closes #32482
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/rte.summernote.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/editor/rte.summernote.js b/addons/web_editor/static/src/js/editor/rte.summernote.js index 2b1f516af84..646c3497e7c 100644 --- a/addons/web_editor/static/src/js/editor/rte.summernote.js +++ b/addons/web_editor/static/src/js/editor/rte.summernote.js @@ -881,7 +881,10 @@ eventHandler.attach = function (oLayoutInfo, options) { show_tooltip = true; setTimeout(function () { - if (!show_tooltip) return; + // Do not show tooltip on double-click and if there is already one + if (!show_tooltip || $target.attr('title') !== undefined) { + return; + } $target.tooltip({title: _t('Double-click to edit'), trigger: 'manuel', container: 'body'}).tooltip('show'); setTimeout(function () { $target.tooltip('destroy'); |
