Some fixes in the visual console.

This commit is contained in:
mdtrooper 2015-06-17 17:03:05 +02:00
parent bf0e89be3a
commit 6faa522187
1 changed files with 20 additions and 26 deletions

View File

@ -1464,7 +1464,7 @@ function getImageElement(id_data) {
return img;
}
function visual_map_get_color_line_status(id) {
function set_color_line_status(lines, line, id_data, values) {
metaconsole = $("input[name='metaconsole']").val();
@ -1477,20 +1477,31 @@ function visual_map_get_color_line_status(id) {
var color = null;
jQuery.ajax({
async: false,
url: get_url_ajax(),
data: parameter,
type: "POST",
dataType: 'json',
success: function (data)
{
color = data['color_line'];
}
success: function (data) {
color = data['color_line'];
var line = {
"id": id_data,
"node_begin": values['parent'],
"node_end": id_data,
"color": color };
lines.push(line);
refresh_lines(lines, 'background', true);
}
});
return color;
}
function createItem(type, values, id_data) {
var sizeStyle = '';
var imageSize = '';
@ -1669,15 +1680,7 @@ function createItem(type, values, id_data) {
$(".box_item").css('z-index', '1');
if (values['parent'] != 0) {
var line = {"id": id_data,
"node_begin": values['parent'],
"node_end": id_data,
"color": visual_map_get_color_line_status(id_data) };
lines.push(line);
refresh_lines(lines, 'background', true);
set_color_line_status(lines, line, id_data, values);
}
}
@ -1845,18 +1848,9 @@ function updateDB_visual(type, idElement , values, event, top, left) {
if (typeof(values['parent']) != 'undefined') {
if (!found) {
var line = {"id": idElement,
"node_begin": values['parent'],
"node_end": idElement,
"color": visual_map_get_color_line_status(idElement) };
lines.push(line);
set_color_line_status(lines, line, idElement, values);
}
}
refresh_lines(lines, 'background', true);
break;
case 'background':
if(values['width'] == '0' || values['height'] == '0'){