diff --git a/app/assets/javascripts/select-kit/addon/components/notifications-button.js b/app/assets/javascripts/select-kit/addon/components/notifications-button.js index d184c7e30ab..46ac8437ac1 100644 --- a/app/assets/javascripts/select-kit/addon/components/notifications-button.js +++ b/app/assets/javascripts/select-kit/addon/components/notifications-button.js @@ -16,16 +16,23 @@ export default DropdownSelectBoxComponent.extend({ i18nPostfix: "", }, - modifyComponentForRow() { + getTitle(key) { + const { i18nPrefix, i18nPostfix } = this.selectKit.options; + return I18n.t(`${i18nPrefix}.${key}${i18nPostfix}.title`); + }, + + modifyComponentForRow(_, content) { + if (content) { + setProperties(content, { + title: this.getTitle(content.key), + }); + } return "notifications-button/notifications-button-row"; }, modifySelection(content) { content = content || {}; - const { i18nPrefix, i18nPostfix } = this.selectKit.options; - const title = I18n.t( - `${i18nPrefix}.${this.buttonForValue.key}${i18nPostfix}.title` - ); + const title = this.getTitle(this.buttonForValue.key); setProperties(content, { title, label: title,