summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_editor/static/src/js')
-rw-r--r--addons/web_editor/static/src/js/editor/snippets.editor.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js
index c425aea6604..ee1bf923902 100644
--- a/addons/web_editor/static/src/js/editor/snippets.editor.js
+++ b/addons/web_editor/static/src/js/editor/snippets.editor.js
@@ -1050,7 +1050,6 @@ var SnippetsMenu = Widget.extend({
const $autoFocusEls = $('.o_we_snippet_autofocus');
this._activateSnippet($autoFocusEls.length ? $autoFocusEls.first() : false);
- this._textToolsSwitchingEnabled = true;
// Add tooltips on we-title elements whose text overflows
this.$el.tooltip({
@@ -1082,6 +1081,12 @@ var SnippetsMenu = Widget.extend({
// animation). (TODO wait for real animation end)
setTimeout(() => {
this.$window.trigger('resize');
+
+ // Hacky way to prevent to switch to text tools on editor
+ // start. Only allow switching after some delay. Switching to
+ // tools is only useful for out-of-snippet texts anyway, so
+ // snippet texts can still be enabled immediately.
+ this._mutex.exec(() => this._textToolsSwitchingEnabled = true);
}, 1000);
});
},