UX: adds title attribute to widget dropdown header (#9597)

This commit is contained in:
Joffrey JAFFEUX 2020-04-30 14:36:21 +02:00 committed by GitHub
parent 7ef8f7bb7c
commit 0d84f3afd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 4 deletions

View File

@ -56,9 +56,11 @@ export const WidgetDropdownHeaderClass = {
tagName: "button",
transform(attrs) {
return {
label: attrs.translatedLabel ? attrs.translatedLabel : I18n.t(attrs.label)
};
return { label: this._buildLabel(attrs) };
},
buildAttributes(attrs) {
return { title: this._buildLabel(attrs) };
},
buildClasses(attrs) {
@ -85,7 +87,11 @@ export const WidgetDropdownHeaderClass = {
{{#if attrs.caret}}
{{d-icon "caret-down"}}
{{/if}}
`
`,
_buildLabel(attrs) {
return attrs.translatedLabel ? attrs.translatedLabel : I18n.t(attrs.label);
}
};
createWidget("widget-dropdown-header", WidgetDropdownHeaderClass);