mirror of
https://github.com/discourse/discourse.git
synced 2025-01-29 05:42:18 +08:00
DEV: Add topic-list-item-expand-pinned
value transformer (#30537)
- Add `topic-list-item-expand-pinned` value transformer
This commit is contained in:
parent
b3772e23bf
commit
b1602d0e7f
|
@ -55,17 +55,23 @@ export default class Item extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
get expandPinned() {
|
get expandPinned() {
|
||||||
|
let expandPinned;
|
||||||
if (
|
if (
|
||||||
!this.args.topic.pinned ||
|
!this.args.topic.pinned ||
|
||||||
(this.site.mobileView && !this.siteSettings.show_pinned_excerpt_mobile) ||
|
(this.site.mobileView && !this.siteSettings.show_pinned_excerpt_mobile) ||
|
||||||
(this.site.desktopView && !this.siteSettings.show_pinned_excerpt_desktop)
|
(this.site.desktopView && !this.siteSettings.show_pinned_excerpt_desktop)
|
||||||
) {
|
) {
|
||||||
return false;
|
expandPinned = false;
|
||||||
|
} else {
|
||||||
|
expandPinned =
|
||||||
|
(this.args.expandGloballyPinned && this.args.topic.pinned_globally) ||
|
||||||
|
this.args.expandAllPinned;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return applyValueTransformer(
|
||||||
(this.args.expandGloballyPinned && this.args.topic.pinned_globally) ||
|
"topic-list-item-expand-pinned",
|
||||||
this.args.expandAllPinned
|
expandPinned,
|
||||||
|
{ topic: this.args.topic, mobileView: this.site.mobileView }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,5 +25,6 @@ export const VALUE_TRANSFORMERS = Object.freeze([
|
||||||
"topic-list-header-sortable-column",
|
"topic-list-header-sortable-column",
|
||||||
"topic-list-class",
|
"topic-list-class",
|
||||||
"topic-list-item-class",
|
"topic-list-item-class",
|
||||||
|
"topic-list-item-expand-pinned",
|
||||||
"topic-list-item-mobile-layout",
|
"topic-list-item-mobile-layout",
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user