summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2019-07-24 07:36:59 +0000
committerMartin Trigaux <mat@odoo.com>2019-07-24 10:32:23 +0000
commita98427834e00380e2e63e08668f5c2b069e3c2ea (patch)
treefbefd4a26124efbaf5e6b4bdbf58ec570014c896 /addons/web_editor/static/src
parent4e6ee3ac97041653ff15a77abd77084dc0c9f525 (diff)
parent860ab5a1c28ba85d7a193d68cfbbb1063bbf0651 (diff)
[MERGE] Forward port of saas-12.2 to saas-12.3 up to 860ab5a1c28ba
closes odoo/odoo#35119 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/wysiwyg/plugin/history.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/wysiwyg/plugin/history.js b/addons/web_editor/static/src/js/wysiwyg/plugin/history.js
index a60ab41523b..addf6383783 100644
--- a/addons/web_editor/static/src/js/wysiwyg/plugin/history.js
+++ b/addons/web_editor/static/src/js/wysiwyg/plugin/history.js
@@ -19,6 +19,12 @@ var HistoryPlugin = Plugins.history.extend({
console.error(e);
}
this.context.invoke('editor.focus');
+ var newRange = this.context.invoke('editor.createRange');
+ if (!this.options.isEditableNode(newRange.sc)) {
+ var firstEditableSel = '[contenteditable="true"]:not(":hidden")';
+ var sc = this.$editable.find(firstEditableSel)[0];
+ this.context.invoke('editor.setRange', sc, 0, sc, 0).select();
+ }
},
/**
* Clear the history.