From 0eba867c8c63538cc0dc4b493daa8d754586e9be Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 2 Jan 2018 17:01:44 -0500 Subject: [PATCH] Allow menu classes to be targetable by name --- app/assets/javascripts/discourse/widgets/menu-panel.js.es6 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/assets/javascripts/discourse/widgets/menu-panel.js.es6 b/app/assets/javascripts/discourse/widgets/menu-panel.js.es6 index 058b64607b5..bca0c606b0c 100644 --- a/app/assets/javascripts/discourse/widgets/menu-panel.js.es6 +++ b/app/assets/javascripts/discourse/widgets/menu-panel.js.es6 @@ -3,6 +3,12 @@ import { createWidget } from 'discourse/widgets/widget'; import { h } from 'virtual-dom'; createWidget('menu-links', { + buildClasses(attrs) { + if (attrs.name && attrs.name.length) { + return `menu-container-${attrs.name}`; + } + }, + html(attrs) { const links = [].concat(attrs.contents()); const liOpts = {};