Browse Source

Fixed change function return

Igor 4 years ago
parent
commit
00a39986da
1 changed files with 4 additions and 1 deletions
  1. 4 1
      js/visualUI/commands/return.js

+ 4 - 1
js/visualUI/commands/return.js

@@ -3,6 +3,7 @@ import { LocalizedStrings } from '../../services/localizedStringsService';
 import * as VariableValueMenu from './variable_value_menu';
 import * as CommandsManagement from '../commands';
 import * as GenericExpressionManagement from './generic_expression';
+import * as Models from '../ivprog_elements';
 
 export function createFloatingCommand () {
 	return $('<div class="ui return created_element"> <i class="ui icon small reply"></i> <span> '+LocalizedStrings.getUI('text_return')+' </span></div>');
@@ -15,7 +16,9 @@ export function renderCommand (command, function_obj) {
 	addHandlers(command, function_obj, el);
 
 	if (function_obj.return_type != Types.VOID) {
-		//VariableValueMenu.renderMenu(command, command.variable_value_menu, el.find('.var_value_menu_div'), function_obj);
+		if (!command.variable_value_menu) {
+			command.variable_value_menu = [new Models.VariableValueMenu(VariableValueMenu.VAR_OR_VALUE_TYPES.all, null, null, null, true)];
+		}
 		GenericExpressionManagement.renderExpression(command, function_obj, el.find('.expression_elements'), command.variable_value_menu);
 	} else {
 		el.find('.expression_elements').remove();