code: function(node) {
      if (!node) {
        node = mindmapModel.selectedNode;
      }
  
      // toggle node visibility
      var action = new mindmaps.action.ToggleNodeFoldAction(node);
      mindmapModel.executeAction(action);
    }
docs: Toggles the fold state of a node.
  
  @param {mindmaps.Node} node