diff options
| author | qsm-odoo <qsm@odoo.com> | 2020-09-28 11:07:30 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2020-09-28 15:09:44 +0000 |
| commit | 0f65015b1b0a849bf109df11fd18a9e3a62820e4 (patch) | |
| tree | 69eff0a67396a6d186ee2593fc29186e687a105c /addons/website/static/src/js | |
| parent | 9dfb85b494efeec7786d345315977b9bcea63b82 (diff) | |
[FIX] web_editor, *: show text tools in style tab only
*: website
As the text editor is still the summernote one, this improvement was
made possible through a series of hack. It has to be reviewed once the
new editor is ready.
This makes the text tools only appear in the style tab by switching to
it as soon as the summernote tools are updated. To prevent flickering,
css and js hacks had to be made.
This also moves the undo/redo buttons in the top bar with another hack:
those simulates click on the hidden summernote ones.
Part of https://github.com/odoo/odoo/pull/58638
Diffstat (limited to 'addons/website/static/src/js')
| -rw-r--r-- | addons/website/static/src/js/editor/editor_menu.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/addons/website/static/src/js/editor/editor_menu.js b/addons/website/static/src/js/editor/editor_menu.js index c78e48f13ad..7249e0d3741 100644 --- a/addons/website/static/src/js/editor/editor_menu.js +++ b/addons/website/static/src/js/editor/editor_menu.js @@ -19,6 +19,8 @@ var EditorMenu = Widget.extend({ template: 'website.editorbar', xmlDependencies: ['/website/static/src/xml/website.editor.xml'], events: { + 'click button[data-action=undo]': '_onUndoClick', + 'click button[data-action=redo]': '_onRedoClick', 'click button[data-action=save]': '_onSaveClick', 'click button[data-action=cancel]': '_onCancelClick', }, @@ -234,6 +236,18 @@ var EditorMenu = Widget.extend({ _onSaveClick: function () { this.save(); }, + /** + * @private + */ + _onUndoClick() { + $('.note-history [data-event=undo]').first().click(); + }, + /** + * @private + */ + _onRedoClick() { + $('.note-history [data-event=redo]').first().click(); + }, }); return EditorMenu; |
