mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 22:06:20 +08:00
Add group name classes to tag page so groups can be hidden with CSS (#8118)
This commit is contained in:
parent
835d2be4da
commit
56862f61c0
|
@ -1,7 +1,7 @@
|
|||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
export default Ember.Component.extend({
|
||||
classNameBindings: [":tag-list", "categoryClass"],
|
||||
classNameBindings: [":tag-list", "categoryClass", "tagGroupNameClass"],
|
||||
|
||||
isPrivateMessage: false,
|
||||
sortedTags: Ember.computed.sort("tags", "sortProperties"),
|
||||
|
@ -19,5 +19,16 @@ export default Ember.Component.extend({
|
|||
@computed("category.fullSlug")
|
||||
categoryClass(slug) {
|
||||
return slug && `tag-list-${slug}`;
|
||||
},
|
||||
|
||||
@computed("tagGroupName")
|
||||
tagGroupNameClass(groupName) {
|
||||
if (groupName) {
|
||||
groupName = groupName
|
||||
.replace(/\s+/g, "-")
|
||||
.replace(/[!\"#$%&'\(\)\*\+,\.\/:;<=>\?\@\[\\\]\^`\{\|\}~]/g, "")
|
||||
.toLowerCase();
|
||||
return groupName && `tag-group-${groupName}`;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user