src/menu/menu.js
// Returns a node showing the collapsed menu, which expands when clicked.
Returns a node showing the collapsed menu, which expands when clicked.
Returns a node showing the collapsed menu which expands when clicked .
render(pm) {
    if (resolveGroup(pm, this.content).length == 0) return
    let label = (this.options.activeLabel && this.findActiveIn(this, pm)) || this.options.label
    let dom = elt("div", {class: prefix + "-dropdown " + (this.options.class || ""),
                          style: this.options.css,
                          title: this.options.title}, label)
    let open = null
    dom.addEventListener("mousedown", e => {
      e.preventDefault(); e.stopPropagation()
      if (open && open()) open = null
      else open = this.expand(pm, dom)
    })
    return dom
  }
render ( pm ) { if ( resolveGroup ( pm , this . content ) . length == 0 ) return let label = ( this . options . activeLabel && this . findActiveIn ( this , pm ) ) || this . options . label let dom = elt ( "div" , { class : prefix + "-dropdown " + ( this . options . class || "" ) , style : this . options . css , title : this . options . title } , label ) let open = null dom . addEventListener ( "mousedown" , e => { e . preventDefault ( ) ; e . stopPropagation ( ) if ( open && open ( ) ) open = null else open = this . expand ( pm , dom ) } ) return dom }
Returns a node showing the collapsed menu, which expands when clicked.
Returns a node showing the collapsed menu which expands when clicked .