summaryrefslogtreecommitdiff
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
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>
-rw-r--r--addons/website/static/src/js/editor/wysiwyg_multizone_translate.js10
-rw-r--r--addons/website/static/src/scss/website.wysiwyg.scss2
2 files changed, 11 insertions, 1 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
diff --git a/addons/website/static/src/scss/website.wysiwyg.scss b/addons/website/static/src/scss/website.wysiwyg.scss
index a2f9a3c394b..2dc34645ed9 100644
--- a/addons/website/static/src/scss/website.wysiwyg.scss
+++ b/addons/website/static/src/scss/website.wysiwyg.scss
@@ -22,7 +22,7 @@
// EDITOR TOP BAR AND POPOVER
.o_we_website_top_actions {
@include o-position-absolute($top: 0, $right: 0);
- z-index: ($zindex-fixed + $zindex-modal-backdrop) / 2 + 1; // $o-we-zindex
+ z-index: ($zindex-fixed + $zindex-modal-backdrop) / 2 + 2; // $o-we-zindex
display: flex;
justify-content: flex-end;
width: $o-we-sidebar-width;