mirror of
https://github.com/discourse/discourse.git
synced 2025-01-29 05:42:18 +08:00
DEV: Support expand-pinned modifier in legacy topic-list (#30587)
This provides an easier upgrade path for themes/plugins. Matches the strategy used for other new topic-list-related modifiers.
This commit is contained in:
parent
116c3f7f8d
commit
210559edc8
|
@ -13,6 +13,7 @@ import { observes, on } from "@ember-decorators/object";
|
||||||
import $ from "jquery";
|
import $ from "jquery";
|
||||||
import { topicTitleDecorators } from "discourse/components/topic-title";
|
import { topicTitleDecorators } from "discourse/components/topic-title";
|
||||||
import { wantsNewWindow } from "discourse/lib/intercept-click";
|
import { wantsNewWindow } from "discourse/lib/intercept-click";
|
||||||
|
import { applyValueTransformer } from "discourse/lib/transformer";
|
||||||
import DiscourseURL, { groupPath } from "discourse/lib/url";
|
import DiscourseURL, { groupPath } from "discourse/lib/url";
|
||||||
import deprecated from "discourse-common/lib/deprecated";
|
import deprecated from "discourse-common/lib/deprecated";
|
||||||
import { RUNTIME_OPTIONS } from "discourse-common/lib/raw-handlebars-helpers";
|
import { RUNTIME_OPTIONS } from "discourse-common/lib/raw-handlebars-helpers";
|
||||||
|
@ -243,6 +244,17 @@ export default class TopicListItem extends Component {
|
||||||
|
|
||||||
@discourseComputed
|
@discourseComputed
|
||||||
expandPinned() {
|
expandPinned() {
|
||||||
|
return applyValueTransformer(
|
||||||
|
"topic-list-item-expand-pinned",
|
||||||
|
this._expandPinned,
|
||||||
|
{
|
||||||
|
topic: this.topic,
|
||||||
|
mobileView: this.site.mobileView,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
get _expandPinned() {
|
||||||
const pinned = this.get("topic.pinned");
|
const pinned = this.get("topic.pinned");
|
||||||
if (!pinned) {
|
if (!pinned) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user