Allow menu classes to be targetable by name

This commit is contained in:
Robin Ward 2018-01-02 17:01:44 -05:00
parent bf7e0188e5
commit 0eba867c8c
1 changed files with 6 additions and 0 deletions

View File

@ -3,6 +3,12 @@ import { createWidget } from 'discourse/widgets/widget';
import { h } from 'virtual-dom'; import { h } from 'virtual-dom';
createWidget('menu-links', { createWidget('menu-links', {
buildClasses(attrs) {
if (attrs.name && attrs.name.length) {
return `menu-container-${attrs.name}`;
}
},
html(attrs) { html(attrs) {
const links = [].concat(attrs.contents()); const links = [].concat(attrs.contents());
const liOpts = {}; const liOpts = {};