mirror of
https://github.com/discourse/discourse.git
synced 2025-01-16 03:42:41 +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 Component from "@glimmer/component";
|
||||||
import { array, concat, hash } from "@ember/helper";
|
import { concat, hash } from "@ember/helper";
|
||||||
import { on } from "@ember/modifier";
|
import { on } from "@ember/modifier";
|
||||||
import { action } from "@ember/object";
|
import { action } from "@ember/object";
|
||||||
import { next } from "@ember/runloop";
|
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>
|
<template>
|
||||||
<tr
|
<tr
|
||||||
{{! template-lint-disable no-invalid-interactive }}
|
{{! template-lint-disable no-invalid-interactive }}
|
||||||
|
@ -206,9 +213,7 @@ export default class Item extends Component {
|
||||||
(if @topic.pinned "pinned")
|
(if @topic.pinned "pinned")
|
||||||
(if @topic.closed "closed")
|
(if @topic.closed "closed")
|
||||||
this.tagClassNames
|
this.tagClassNames
|
||||||
(applyValueTransformer
|
this.additionalClasses
|
||||||
"topic-list-item-class" (array) (hash topic=@topic index=@index)
|
|
||||||
)
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<PluginOutlet
|
<PluginOutlet
|
||||||
|
|
Loading…
Reference in New Issue
Block a user