[IMP] web_editor: page options activated on click on the customize tab

With this commit, clicking on the "customize" tab automatically
activates the page options (if there are any). This commit also replaces
the name of the "style" tab by naming it "customize".

task-2710582
This commit is contained in:
Benjamin Vray
2022-06-24 10:28:05 +02:00
committed by qsm-odoo
parent 1216cea321
commit dab8827e3b
2 changed files with 13 additions and 2 deletions
@@ -2948,7 +2948,18 @@ var SnippetsMenu = Widget.extend({
if (!ev.currentTarget.classList.contains('active')) {
this._activateSnippet(false);
this._mutex.exec(() => {
this._activateEmptyOptionsTab();
let $pageOptionsTarget = $();
let i = 0;
const pageOptions = this.templateOptions.filter(template => template.data.pageOptions);
while (!$pageOptionsTarget.length && i < pageOptions.length) {
$pageOptionsTarget = pageOptions[i].selector.all();
i++;
}
if ($pageOptionsTarget.length) {
this._activateSnippet($pageOptionsTarget);
} else {
this._activateEmptyOptionsTab();
}
});
}
},
+1 -1
View File
@@ -18,7 +18,7 @@
<span>Blocks</span>
</button>
<button type="button" tabindex="2" class="o_we_customize_snippet_btn text-uppercase">
<span>Style</span>
<span>Customize</span>
</button>
</div>