Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion javascripts/discourse/services/topic-list-previews.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ export default Service.extend({
itemShortRouteName = item.substring(0,item.indexOf("-mobile"))
}

if (settings.topic_list_set_category_defaults) {
if (currentTopicListRoute.indexOf("Category") > -1) {
currentTopicListRoute = item.substring(0,item.indexOf("Category"))
} else {
if (currentTopicListRoute == 'discovery.category') {
currentTopicListRoute = 'discovery.latest'
}
}
}

if (currentTopicListRoute.indexOf(itemShortRouteName) > -1 && ((onMobile && mobileSetting) || (!onMobile && !mobileSetting))) {
return true;
}
Expand Down Expand Up @@ -154,4 +164,4 @@ export default Service.extend({
displayActions(enabledForRoute, displayMode) {
return enabledForRoute && displayMode.includes("actions");
},
});
});
10 changes: 5 additions & 5 deletions settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ topic_list_actions_tags:
default: ""
description:
en: "The tags that will include actions."
topic_list_set_category_defaults:
default: false
type: bool
description:
en: "Set site topic list display settings as defaults for category topic lists."
topic_list_show_like_on_current_users_posts:
type: bool
default: true
Expand Down Expand Up @@ -99,11 +104,6 @@ topic_list_portfolio_filter_parameter:
type: string
description:
en: "Enter the tag or category slug (depending of value of filter type setting)"
topic_list_set_category_defaults:
default: false
type: bool
description:
en: "Set site topic list display settings as defaults for category topic lists."
topic_list_default_thumbnail:
default: ''
type: string
Expand Down