mirror of
https://github.com/discourse/discourse.git
synced 2025-01-16 03:52:41 +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() {
|
||||
let expandPinned;
|
||||
if (
|
||||
!this.args.topic.pinned ||
|
||||
(this.site.mobileView && !this.siteSettings.show_pinned_excerpt_mobile) ||
|
||||
(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 (
|
||||
(this.args.expandGloballyPinned && this.args.topic.pinned_globally) ||
|
||||
this.args.expandAllPinned
|
||||
return applyValueTransformer(
|
||||
"topic-list-item-expand-pinned",
|
||||
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-class",
|
||||
"topic-list-item-class",
|
||||
"topic-list-item-expand-pinned",
|
||||
"topic-list-item-mobile-layout",
|
||||
]);
|
||||
|
|
Loading…
Reference in New Issue
Block a user