Skip to content

A platform for community discussion. Free, open, simple.

DEV: Use `concat-class` helper when setting class for `DButton` (#21998)

Alan Guo Xiang Tanb4611114f960
diff --git a/app/assets/javascripts/discourse/app/components/d-button.hbs b/app/assets/javascripts/discourse/app/components/d-button.hbs
index 09b44b2ed2e..4719a12dacd 100644
--- a/app/assets/javascripts/discourse/app/components/d-button.hbs
+++ b/app/assets/javascripts/discourse/app/components/d-button.hbs
@@ -1,11 +1,13 @@
{{! template-lint-disable no-down-event-binding }}
<button
{{! For legacy compatibility. Prefer passing class as attributes. }}
- class="{{@class}}
- {{if @isLoading 'is-loading'}}
- {{if this.btnLink 'btn-link' 'btn'}}
- {{if this.noText 'no-text'}}
- {{this.btnType}}"
+ class={{concat-class
+ @class
+ (if @isLoading "is-loading")
+ (if this.btnLink "btn-link" "btn")
+ (if this.noText "no-text")
+ this.btnType
+ }}
{{! For legacy compatibility. Prefer passing these as html attributes. }}
id={{@id}}
form={{@form}}