src/menu/menu.js
// appear when some of the groups turn out to be empty).
appear when some of the groups turn out to be empty).
appear when some of the groups turn out to be empty ) .
function renderGrouped(pm, content) {
  let result = document.createDocumentFragment(), needSep = false
  for (let i = 0; i < content.length; i++) {
    let items = resolveGroup(pm, content[i]), added = false
    for (let j = 0; j < items.length; j++) {
      let rendered = items[j].render(pm)
      if (rendered) {
        if (!added && needSep) result.appendChild(separator())
        result.appendChild(elt("span", {class: prefix + "item"}, rendered))
        added = true
      }
    }
    if (added) needSep = true
  }
  return result
}
function renderGrouped ( pm , content ) { let result = document . createDocumentFragment ( ) , needSep = false for ( let i = 0 ; i < content . length ; i ++ ) { let items = resolveGroup ( pm , content [ i ] ) , added = false for ( let j = 0 ; j < items . length ; j ++ ) { let rendered = items [ j ] . render ( pm ) if ( rendered ) { if ( ! added && needSep ) result . appendChild ( separator ( ) ) result . appendChild ( elt ( "span" , { class : prefix + "item" } , rendered ) ) added = true } } if ( added ) needSep = true } return result }
appear when some of the groups turn out to be empty).
appear when some of the groups turn out to be empty ) .