Skip to content

Commit 14a0f92

Browse files
authored
DEV: Replace @actionParam with {{fn}} (#229)
1 parent 589a7a8 commit 14a0f92

1 file changed

Lines changed: 12 additions & 18 deletions

File tree

  • assets/javascripts/discourse/templates/docs

assets/javascripts/discourse/templates/docs/index.gjs

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,22 @@ export default RouteTemplate(
6060
</h3>
6161
<div class="item-controls-buttons">
6262
<DButton
63+
@action={{fn @controller.toggleCategorySort "alpha"}}
64+
@icon={{@controller.categorySortAlphaIcon}}
6365
class={{if
6466
(eq @controller.categorySort.type "alpha")
6567
"categories-alphabet active"
6668
"categories-alphabet"
6769
}}
68-
@icon={{@controller.categorySortAlphaIcon}}
69-
@action={{@controller.toggleCategorySort}}
70-
@actionParam="alpha"
7170
/>
7271
<DButton
72+
@action={{fn @controller.toggleCategorySort "numeric"}}
73+
@icon={{@controller.categorySortNumericIcon}}
7374
class={{if
7475
(eq @controller.categorySort.type "numeric")
7576
"categories-amount active"
7677
"categories-amount"
7778
}}
78-
@icon={{@controller.categorySortNumericIcon}}
79-
@action={{@controller.toggleCategorySort}}
80-
@actionParam="numeric"
8179
/>
8280
<PluginOutlet
8381
@name="categories-controls-buttons-bottom"
@@ -115,24 +113,22 @@ export default RouteTemplate(
115113
</h3>
116114
<div class="item-controls-buttons">
117115
<DButton
116+
@action={{fn @controller.toggleTagSort "alpha"}}
117+
@icon={{@controller.tagSortAlphaIcon}}
118118
class={{if
119119
(eq @controller.tagSort.type "alpha")
120120
"tags-alphabet active"
121121
"tags-alphabet"
122122
}}
123-
@icon={{@controller.tagSortAlphaIcon}}
124-
@action={{@controller.toggleTagSort}}
125-
@actionParam="alpha"
126123
/>
127124
<DButton
125+
@action={{fn @controller.toggleTagSort "numeric"}}
126+
@icon={{@controller.tagSortNumericIcon}}
128127
class={{if
129128
(eq @controller.tagSort.type "numeric")
130129
"tags-amount active"
131130
"tags-amount"
132131
}}
133-
@icon={{@controller.tagSortNumericIcon}}
134-
@action={{@controller.toggleTagSort}}
135-
@actionParam="numeric"
136132
/>
137133
<PluginOutlet @name="tags-controls-buttons-bottom" />
138134
</div>
@@ -174,24 +170,22 @@ export default RouteTemplate(
174170
</h3>
175171
<div class="item-controls-buttons">
176172
<DButton
173+
@action={{fn @controller.toggleTagSort "alpha"}}
174+
@icon={{@controller.tagSortAlphaIcon}}
177175
class={{if
178176
(eq @controller.tagSort.type "alpha")
179177
"tags-alphabet active"
180178
"tags-alphabet"
181179
}}
182-
@icon={{@controller.tagSortAlphaIcon}}
183-
@action={{@controller.toggleTagSort}}
184-
@actionParam="alpha"
185180
/>
186181
<DButton
182+
@action={{fn @controller.toggleTagSort "numeric"}}
183+
@icon={{@controller.tagSortNumericIcon}}
187184
class={{if
188185
(eq @controller.tagSort.type "numeric")
189186
"tags-amount active"
190187
"tags-amount"
191188
}}
192-
@icon={{@controller.tagSortNumericIcon}}
193-
@action={{@controller.toggleTagSort}}
194-
@actionParam="numeric"
195189
/>
196190
<PluginOutlet @name="tags-controls-buttons-bottom" />
197191
</div>

0 commit comments

Comments
 (0)