diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-07-29 14:10:30 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-07-29 14:10:30 +0200 |
| commit | d5e1fd16b4fd796cc25b2b2d694dadb375110ce7 (patch) | |
| tree | 35d130b4161985cd9ca3071a59980b52e8401be5 /addons/web_editor/static/src/js/wysiwyg/plugin | |
| parent | ae71f95371b4a5c99c10a23e3553c5badc45a1ac (diff) | |
| parent | cda4f3c308ca233aead81f5ae97d250b5b7bf82f (diff) | |
[MERGE] forward port branch saas-12.4 up to cda4f3c308c
Diffstat (limited to 'addons/web_editor/static/src/js/wysiwyg/plugin')
| -rw-r--r-- | addons/web_editor/static/src/js/wysiwyg/plugin/history.js | 6 |
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. |
