mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
UX: Add subcategory class to hamburger menu items that are subcategories
UX: Add data-category-url to make targetting a category li element in the hamburger menu easier
This commit is contained in:
@ -6,6 +6,12 @@ createWidget('hamburger-category', {
|
|||||||
tagName: 'li.category-link',
|
tagName: 'li.category-link',
|
||||||
|
|
||||||
html(c) {
|
html(c) {
|
||||||
|
if (c.parent_category_id) {
|
||||||
|
this.tagName += '.subcategory';
|
||||||
|
}
|
||||||
|
|
||||||
|
this.tagName += '.category-' + Discourse.Category.slugFor(c, '-');
|
||||||
|
|
||||||
const results = [ this.attach('category-link', { category: c, allowUncategorized: true }) ];
|
const results = [ this.attach('category-link', { category: c, allowUncategorized: true }) ];
|
||||||
|
|
||||||
const unreadTotal = parseInt(c.get('unreadTopics'), 10) + parseInt(c.get('newTopics'), 10);
|
const unreadTotal = parseInt(c.get('unreadTopics'), 10) + parseInt(c.get('newTopics'), 10);
|
||||||
|
Reference in New Issue
Block a user