fix(shared): Handle nested option groups in menu
This commit is contained in:
parent
d23cd7f531
commit
370d3be24d
3 changed files with 11 additions and 36 deletions
|
@ -203,6 +203,15 @@ export const optionsMenuStructure = (options, settings) => {
|
|||
if (oType === 'pct') option.dflt /= 100
|
||||
if (typeof option.menu === 'function') option.menu = option.menu(settings)
|
||||
if (option.menu) {
|
||||
// Handle nested groups that don't have any direct children
|
||||
if (option.menu.includes('.')) {
|
||||
let menuPath = []
|
||||
for (const chunk of option.menu.split('.')) {
|
||||
menuPath.push(chunk)
|
||||
set(menu, `${menuPath.join('.')}.isGroup`, true)
|
||||
}
|
||||
}
|
||||
const menuPath = option.menu.split('.')
|
||||
set(menu, `${option.menu}.isGroup`, true)
|
||||
set(menu, `${option.menu}.${option.name}`, option)
|
||||
} else if (typeof option.menu === 'undefined') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue