[IMP] web_editor: allow left-panel select to have custom active labels
Instead of the text of the selected option displayed as label, we may want another text (especially if the choice has long text). This can be defined on buttons with 'data-select-label'. Part of https://github.com/odoo/odoo/pull/52211 Related to task-2197038
This commit is contained in:
@@ -723,7 +723,11 @@ const SelectUserValueWidget = UserValueWidget.extend({
|
||||
}
|
||||
|
||||
const activeWidget = this._userValueWidgets.find(widget => !widget.isPreviewed() && widget.isActive());
|
||||
this.menuTogglerEl.textContent = activeWidget ? activeWidget.el.textContent : "/";
|
||||
let value = "/";
|
||||
if (activeWidget) {
|
||||
value = activeWidget.el.dataset.selectLabel || activeWidget.el.textContent;
|
||||
}
|
||||
this.menuTogglerEl.textContent = value;
|
||||
},
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user