[FIX] web_editor: not showing toolbar in theme tab

In the website builder, the toolbar was appearing in the theme tab
incorrectly.

task-2664956

closes odoo/odoo#79311

X-original-commit: a2198490befddb8c4cc6f3a543f47bbffe243f64
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
Nicolas Bayet
2021-11-03 12:38:59 +00:00
parent 03676ae11a
commit bd8260b3f5
@@ -166,6 +166,7 @@ var SnippetEditor = Widget.extend({
this.$scrollingElement = $(this.ownerDocument).find('.o_editable');
}
this.displayOverlayOptions = false;
this._$toolbarContainer = $();
this.__isStarted = new Promise(resolve => {
this.__isStartedResolveFunc = resolve;
@@ -2522,6 +2523,7 @@ var SnippetsMenu = Widget.extend({
this._currentTab = tab || this.tabs.BLOCKS;
this._$toolbarContainer[0].remove();
if (content) {
while (this.customizePanel.firstChild) {
this.customizePanel.removeChild(this.customizePanel.firstChild);
@@ -3156,12 +3158,12 @@ var SnippetsMenu = Widget.extend({
this.options.wysiwyg.toolbar.el.classList.remove('oe-floating');
// Create toolbar custom container.
const $customizeBlock = $('<WE-CUSTOMIZEBLOCK-OPTIONS id="o_we_editor_toolbar_container"/>');
this._$toolbarContainer = $('<WE-CUSTOMIZEBLOCK-OPTIONS id="o_we_editor_toolbar_container"/>');
const $title = $("<we-title><span>" + titleText + "</span></we-title>");
$customizeBlock.append($title);
$customizeBlock.append(this.options.wysiwyg.toolbar.$el);
$(this.customizePanel).append($customizeBlock);
this._$toolbarContainer.append($title);
this._$toolbarContainer.append(this.options.wysiwyg.toolbar.$el);
$(this.customizePanel).append(this._$toolbarContainer);
// Create table-options custom container.
const $customizeTableBlock = $(QWeb.render('web_editor.toolbar.table-options'));