function customContextMenu(options) {
    if (!this.workspace.isMovable()) {
      // If we center on the block and the workspace isn't movable we could
      // loose blocks at the edges of the workspace.
      return;
    }

    var workspace = this.workspace;
    var block = this; // Highlight Definition

    var option = {
      enabled: true
    };
    option.text = Blockly.Msg['PROCEDURES_HIGHLIGHT_DEF'];
    var name = this.getProcedureCall();

    option.callback = function () {
      var def = Blockly.Procedures.getDefinition(name, workspace);

      if (def) {
        workspace.centerOnBlock(def.id);
        def.select();
      }
    };

    options.push(option); // Show Parameter Names

    options.push({
      enabled: true,
      text: "Show/Hide parameters",
      callback: function callback() {
        block.showParameterNames_ = !block.showParameterNames_;
        block.updateShape_();
        block.render();
      }
    }); // Change Return Type

    options.push({
      enabled: true,
      text: this.returns_ ? "Make statement" : "Make expression",
      callback: function callback() {
        block.returns_ = !block.returns_;
        block.setReturn_(block.returns_, true);
      }
    });
  }
/**
   * Add menu option to find the definition block for this call.
   * @param {!Array} options List of menu options to add to.
   * @this Blockly.Block
   */
Add menu option to find the definition block for this call.
@param {!Array} options List of menu options to add to.
Add menu option to find the definition block for this call . @param { !Array } options List of menu options to add to .
function customContextMenu(options) {
    if (!this.workspace.isMovable()) {
      return;
    }
    var workspace = this.workspace;
    var block = this; 
    var option = {
      enabled: true
    };
    option.text = Blockly.Msg['PROCEDURES_HIGHLIGHT_DEF'];
    var name = this.getProcedureCall();
    option.callback = function () {
      var def = Blockly.Procedures.getDefinition(name, workspace);
      if (def) {
        workspace.centerOnBlock(def.id);
        def.select();
      }
    };
    options.push(option); 
    options.push({
      enabled: true,
      text: "Show/Hide parameters",
      callback: function callback() {
        block.showParameterNames_ = !block.showParameterNames_;
        block.updateShape_();
        block.render();
      }
    }); 
    options.push({
      enabled: true,
      text: this.returns_ ? "Make statement" : "Make expression",
      callback: function callback() {
        block.returns_ = !block.returns_;
        block.setReturn_(block.returns_, true);
      }
    });
  }
function customContextMenu ( options ) { if ( ! this . workspace . isMovable ( ) ) { return ; } var workspace = this . workspace ; var block = this ; var option = { enabled : true } ; option . text = Blockly . Msg [ 'PROCEDURES_HIGHLIGHT_DEF' ] ; var name = this . getProcedureCall ( ) ; option . callback = function ( ) { var def = Blockly . Procedures . getDefinition ( name , workspace ) ; if ( def ) { workspace . centerOnBlock ( def . id ) ; def . select ( ) ; } } ; options . push ( option ) ; options . push ( { enabled : true , text : "Show/Hide parameters" , callback : function callback ( ) { block . showParameterNames_ = ! block . showParameterNames_ ; block . updateShape_ ( ) ; block . render ( ) ; } } ) ; options . push ( { enabled : true , text : this . returns_ ? "Make statement" : "Make expression" , callback : function callback ( ) { block . returns_ = ! block . returns_ ; block . setReturn_ ( block . returns_ , true ) ; } } ) ; }
Add menu option to find the definition block for this call.
Add menu option to find the definition block for this call .
// If we center on the block and the workspace isn't movable we could // loose blocks at the edges of the workspace. // Highlight Definition // Show Parameter Names // Change Return Type