mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 13:31:03 +08:00
UX: set tag sort based on siteSetting (#24147)
This commit is contained in:
parent
2e06cc1248
commit
fbf8528814
|
@ -13,6 +13,7 @@ export default Controller.extend({
|
|||
modal: service(),
|
||||
sortedByCount: true,
|
||||
sortedByName: false,
|
||||
sortAlphabetically: alias("siteSettings.tags_sort_alphabetically"),
|
||||
canAdminTags: alias("currentUser.staff"),
|
||||
groupedByCategory: notEmpty("model.extras.categories"),
|
||||
groupedByTagGroup: notEmpty("model.extras.tag_groups"),
|
||||
|
@ -20,7 +21,13 @@ export default Controller.extend({
|
|||
init() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.sortProperties = ["totalCount:desc", "id"];
|
||||
const isAlphaSort = this.sortAlphabetically;
|
||||
|
||||
this.setProperties({
|
||||
sortedByCount: isAlphaSort ? false : true,
|
||||
sortedByName: isAlphaSort ? true : false,
|
||||
sortProperties: isAlphaSort ? ["id"] : ["totalCount:desc", "id"],
|
||||
});
|
||||
},
|
||||
|
||||
@discourseComputed("groupedByCategory", "groupedByTagGroup")
|
||||
|
|
Loading…
Reference in New Issue
Block a user