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:
cpradio 2017-03-13 08:34:12 -04:00
parent 068ce19ae2
commit 15f7fff561

View File

@ -6,6 +6,12 @@ createWidget('hamburger-category', {
tagName: 'li.category-link',
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 unreadTotal = parseInt(c.get('unreadTopics'), 10) + parseInt(c.get('newTopics'), 10);