mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 04:33:37 +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";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
classNameBindings: [":tag-list", "categoryClass"],
|
classNameBindings: [":tag-list", "categoryClass", "tagGroupNameClass"],
|
||||||
|
|
||||||
isPrivateMessage: false,
|
isPrivateMessage: false,
|
||||||
sortedTags: Ember.computed.sort("tags", "sortProperties"),
|
sortedTags: Ember.computed.sort("tags", "sortProperties"),
|
||||||
|
@ -19,5 +19,16 @@ export default Ember.Component.extend({
|
||||||
@computed("category.fullSlug")
|
@computed("category.fullSlug")
|
||||||
categoryClass(slug) {
|
categoryClass(slug) {
|
||||||
return slug && `tag-list-${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