import $ from 'jquery';
import { Types } from '../types';
import * as Models from '../ivprog_elements';
import { LocalizedStrings } from '../../services/localizedStringsService';
import * as GlobalsManagement from '../globals';
import * as VariablesManagement from '../variables';
import * as CommandsManagement from '../commands';
export function createFloatingCommand () {
return $('
if (x < 1) { ';
ret += '
';
/*if ((writer_obj.commands_block == null)
|| (writer_obj.commands_block.length == 0)) {
} else {
for (ki = 0; ki < writer_obj.commands_block.length; ki ++) {
ret += renderElementCommandGeneric(writer_obj.commands_block[ki], function_index, ki, iftrue_index, (fullpath + ',' + ki));
}
}*/
ret += '
';
ret += '
} else { ';
ret += '
';
/*if ((writer_obj.commands_else == null)
|| (writer_obj.commands_else.length == 0)) {
} else {
for (ki = 0; ki < writer_obj.commands_else.length; ki ++) {
ret += renderElementCommandGeneric(writer_obj.commands_else[ki], function_index, ki, iftrue_index, (fullpath + ',' + ki));
}
}*/
ret += '
';
ret += '
}';
ret += '
';
var el = $(ret);
el.data('command', command);
addHandlers(command, function_obj, el);
return el;
}
function addHandlers (command, function_obj, iftrue_dom) {
iftrue_dom.find('.button_remove_command').on('click', function() {
if (CommandsManagement.removeCommand(command, function_obj, iftrue_dom)) {
iftrue_dom.remove();
}
});
}