summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorAntoine Guenet <age@odoo.com>2019-04-19 09:57:50 +0000
committerAntoine Guenet <age@odoo.com>2019-04-19 10:23:21 +0000
commit706bf8551273cff9616e0f44c61d05b521aa0446 (patch)
tree0bb67c3a8a0d2130874fe910b177f4a3b264816f /addons/web_editor/static/src
parent45e80f56b9e29bf96fbd0ed37478096518418528 (diff)
[FIX] web_editor: disable tooltips in keyboard tests and on option off
The link and media tooltips were not taking Summernote's `tooltip` option into account. That option ensures that tooltips are disabled if the option is off (which is for instance the case on mobile). This fix ensures that these tooltips are disabled when the option is set to `false`. It also disables tooltips in the keyboard tests. They are not relevant to the keyboard tests and occasionally caused the DOM to not be properly cleaned after the tests were run (most likely due to their 2000ms `setTimeout`).
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/wysiwyg/plugin/link.js4
-rw-r--r--addons/web_editor/static/src/js/wysiwyg/plugin/media.js4
2 files changed, 4 insertions, 4 deletions
diff --git a/addons/web_editor/static/src/js/wysiwyg/plugin/link.js b/addons/web_editor/static/src/js/wysiwyg/plugin/link.js
index 1b75339bf54..d8d261df980 100644
--- a/addons/web_editor/static/src/js/wysiwyg/plugin/link.js
+++ b/addons/web_editor/static/src/js/wysiwyg/plugin/link.js
@@ -358,12 +358,12 @@ var LinkPopover = Plugins.linkPopover.extend({
var $target = $(anchor);
- if (!$target.data('show_tooltip')) {
+ if (!$target.data('show_tooltip') && this.context.options.tooltip) {
$target.data('show_tooltip', true);
setTimeout(function () {
$target.tooltip({
title: _t('Double-click to edit'),
- trigger: 'manuel',
+ trigger: 'manual',
container: this.document.body,
placement: 'top'
}).tooltip('show');
diff --git a/addons/web_editor/static/src/js/wysiwyg/plugin/media.js b/addons/web_editor/static/src/js/wysiwyg/plugin/media.js
index ce58a4eac86..85ac5f222f4 100644
--- a/addons/web_editor/static/src/js/wysiwyg/plugin/media.js
+++ b/addons/web_editor/static/src/js/wysiwyg/plugin/media.js
@@ -114,12 +114,12 @@ var MediaPlugin = AbstractPlugin.extend({
this.context.invoke('editor.saveTarget', target);
var $target = $(target);
- if (!$target.data('show_tooltip')) {
+ if (!$target.data('show_tooltip') && this.context.options.tooltip) {
$target.data('show_tooltip', true);
setTimeout(function () {
$target.tooltip({
title: _t('Double-click to edit'),
- trigger: 'manuel',
+ trigger: 'manual',
container: this.document.body,
}).tooltip('show');
setTimeout(function () {