mirror of
https://github.com/discourse/discourse.git
synced 2025-01-16 00:42:43 +08:00
DEV: Move topic-list-item-class transformer to a getter (#30726)
See 03bb43f
This commit is contained in:
parent
af8f01a0d3
commit
7a4da92657
|
@ -1,5 +1,5 @@
|
|||
import Component from "@glimmer/component";
|
||||
import { array, concat, hash } from "@ember/helper";
|
||||
import { concat, hash } from "@ember/helper";
|
||||
import { on } from "@ember/modifier";
|
||||
import { action } from "@ember/object";
|
||||
import { next } from "@ember/runloop";
|
||||
|
@ -183,6 +183,13 @@ export default class Item extends Component {
|
|||
);
|
||||
}
|
||||
|
||||
get additionalClasses() {
|
||||
return applyValueTransformer("topic-list-item-class", [], {
|
||||
topic: this.args.topic,
|
||||
index: this.args.index,
|
||||
});
|
||||
}
|
||||
|
||||
<template>
|
||||
<tr
|
||||
{{! template-lint-disable no-invalid-interactive }}
|
||||
|
@ -206,9 +213,7 @@ export default class Item extends Component {
|
|||
(if @topic.pinned "pinned")
|
||||
(if @topic.closed "closed")
|
||||
this.tagClassNames
|
||||
(applyValueTransformer
|
||||
"topic-list-item-class" (array) (hash topic=@topic index=@index)
|
||||
)
|
||||
this.additionalClasses
|
||||
}}
|
||||
>
|
||||
<PluginOutlet
|
||||
|
|
Loading…
Reference in New Issue
Block a user