DEV: Fix passing translatedTitle as argument to flat-button (#29663)
Overriding computed properties with arguments is no longer supported by Ember, so we need to rename this computed property and add fallback logic manually. This fixes the styleguide 'buttons' page. Ref https://meta.discourse.org/t/styleguide-bugs/335211?u=david
This commit is contained in:
parent
698571e24b
commit
3a23ff98bc
|
@ -9,12 +9,14 @@ import I18n from "discourse-i18n";
|
|||
|
||||
@tagName("button")
|
||||
@classNames("btn-flat")
|
||||
@attributeBindings("disabled", "translatedTitle:title")
|
||||
@attributeBindings("disabled", "resolvedTitle:title")
|
||||
export default class FlatButton extends Component {
|
||||
@discourseComputed("title")
|
||||
translatedTitle(title) {
|
||||
@discourseComputed("title", "translatedTitle")
|
||||
resolvedTitle(title, translatedTitle) {
|
||||
if (title) {
|
||||
return I18n.t(title);
|
||||
} else if (translatedTitle) {
|
||||
return translatedTitle;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue