summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2020-09-23 13:45:21 +0000
committerqsm-odoo <qsm@odoo.com>2020-09-23 17:32:33 +0000
commitb9d4ccfc8db1f3425b8ee0e8d6311ebaac0f26b2 (patch)
treefe608652ecd496ed8e35e0aea19a730aca165c19 /addons/website/static/src/js
parentbe59e6cd0d30c8e5fb70311db4d9657826a9d43f (diff)
[FIX] website: restore top editor bar for translate mode
The text tools were moved in the right panel with a temporary solution but as there is no right panel in translate mode, the text tools were just floating summernote-way. This commit restores the top editor bar in that case while waiting for the new editor. Part of https://github.com/odoo/odoo/pull/58347 closes odoo/odoo#58347 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/website/static/src/js')
-rw-r--r--addons/website/static/src/js/editor/wysiwyg_multizone_translate.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/addons/website/static/src/js/editor/wysiwyg_multizone_translate.js b/addons/website/static/src/js/editor/wysiwyg_multizone_translate.js
index 0541d60bf33..978ac4d98a6 100644
--- a/addons/website/static/src/js/editor/wysiwyg_multizone_translate.js
+++ b/addons/website/static/src/js/editor/wysiwyg_multizone_translate.js
@@ -91,6 +91,9 @@ var WysiwygTranslate = WysiwygMultizone.extend({
*/
start: function () {
var self = this;
+ // Hacky way to keep the top editor toolbar in translate mode for now
+ this.$webEditorTopEdit = $('<div id="web_editor-top-edit"></div>').prependTo(document.body);
+ this.options.toolbarHandler = this.$webEditorTopEdit;
this.editor = new (this.Editor)(this, Object.assign({Editor: RTETranslatorWidget}, this.options));
this.$editor = this.editor.rte.editable();
var promise = this.editor.prependTo(this.$editor[0].ownerDocument.body);
@@ -133,6 +136,13 @@ var WysiwygTranslate = WysiwygMultizone.extend({
self._markTranslatableNodes();
});
},
+ /**
+ * @override
+ */
+ destroy: function () {
+ this._super(...arguments);
+ this.$webEditorTopEdit.remove();
+ },
//--------------------------------------------------------------------------
// Public