New maps in progress... (Edit node in progress)

This commit is contained in:
Arturo Gonzalez 2016-04-07 12:24:24 +02:00
parent e289699c48
commit 09f156cd8c
2 changed files with 31 additions and 16 deletions

View File

@ -328,11 +328,12 @@ if (is_ajax ()) {
$id_node_data = (int)get_parameter('id_node_data');
$type = (int)get_parameter('type');
$node_id = get_parameter('node_id');
$data_graph_id = (int)get_parameter('data_graph_id');
$table = new stdClass();
$table->id = 'node_options_' . $node_id;
$table->width = "100%";
$table->head = array();
$node_name = __('No name');
@ -356,22 +357,18 @@ if (is_ajax ()) {
$table->data = array();
$table->data[0][0] = __('Label');
$table->data[0][1] = html_print_input_text('label',
$node_style['label'], '', 5, 10, true);
$table->data[3][0] = __('Shape');
$table->data[3][1] = html_print_select(array(
$node_name, '', 12, 10, true);
$table->data[1][0] = __('Shape');
$table->data[1][1] = html_print_select(array(
'circle' => __('Circle'),
'square' => __('Square'),
'rhombus' => __('Rhombus')), 'shape', '',
'javascript:', '', 0, true) . ' ' .
'<span id="shape_icon_in_progress" style="display: none;">' .
html_print_image('images/spinner.gif', true) . '</span>' .
'<span id="shape_icon_correct" style="display: none;">' .
html_print_image('images/dot_green.png', true) . '</span>' .
'<span id="shape_icon_fail" style="display: none;">' .
html_print_image('images/dot_red.png', true) . '</span>';
ui_toggle(html_print_table($table, true), __('Node options'),
__('Node options'), true);
'rhombus' => __('Rhombus')), 'shape', 'circle', '', '', 0, true);
html_print_table($table);
echo '<form method="post" style="float:right; margin-right: 10px;">';
echo html_print_button(__('Update'), 'upd', false, 'update_node(' . $data_graph_id . ');') .
ui_print_help_tip (__('This function is only fix in Enterprise version'));
echo '</form>';
?>
</div>
</div>

View File

@ -2415,7 +2415,6 @@ MapController.prototype.editNode = function(self, target) {
params["printEditNodeTable"] = 1;
params["id_node_data"] = data_id;
params["type"] = type;
params["id_map"] = id_map;
params["data_graph_id"] = data_graph_id;
params["node_id"] = node_id;
params["page"] = "include/ajax/map.ajax";
@ -2865,3 +2864,22 @@ function get_radius_element(element) {
return Math.sqrt(
Math.pow(size[0] / 2, 2) + Math.pow(size[1] / 2, 2));
}
function update_node(data_graph_id) {
node_id = "node_" + data_graph_id;
var new_label = $("#edit_node_dialog_" + node_id + " input[id='text-label']").val();
var new_shape = $("#edit_node_dialog_" + node_id + " select[id='shape']").val();
$('#' + node_id + " text").text(new_label);
switch (new_shape) {
case 'circle':
break;
case 'rhombus':
break;
case 'square':
break;
}
console.log(new_label, new_shape);
}