From 309e9e900eec4fb128f7a45458192811bc85b036 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Mon, 22 May 2017 17:31:29 +0200 Subject: [PATCH 1/2] Added margin top value to images when have lines --- .../javascript/pandora_visual_console.js | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/pandora_console/include/javascript/pandora_visual_console.js b/pandora_console/include/javascript/pandora_visual_console.js index 2767a8105b..4200aeca66 100755 --- a/pandora_console/include/javascript/pandora_visual_console.js +++ b/pandora_console/include/javascript/pandora_visual_console.js @@ -38,6 +38,30 @@ function draw_line (line, id_div) { have_node_begin_img = $('#' + line['node_begin'] + " img").length; have_node_end_img = $('#' + line['node_end'] + " img").length; +<<<<<<< Updated upstream +======= + if (have_node_begin_img) { + var img_pos_begin = $('#' + line['node_begin'] + " img").position(); + var img_margin_left_begin = $('#' + line['node_begin'] + " img").css("margin-left"); + var img_margin_left_begin_aux = img_margin_left_begin.split("px"); + img_margin_left_begin = parseFloat(img_margin_left_begin_aux[0]); + + var img_margin_top_begin = $('#' + line['node_begin'] + " img").css("margin-top"); + var img_margin_top_begin_aux = img_margin_top_begin.split("px"); + img_margin_top_begin = parseFloat(img_margin_top_begin_aux[0]); + } + if (have_node_end_img) { + var img_pos_end = $('#' + line['node_end'] + " img").position(); + var img_margin_left_end = $('#' + line['node_end'] + " img").css("margin-left"); + var img_margin_left_end_aux = img_margin_left_end.split("px"); + img_margin_left_end = parseFloat(img_margin_left_end_aux[0]); + + var img_margin_top_end = $('#' + line['node_end'] + " img").css("margin-top"); + var img_margin_top_end_aux = img_margin_top_end.split("px"); + img_margin_top_end = parseFloat(img_margin_top_end_aux[0]); + } + +>>>>>>> Stashed changes if (line['x1']) { x1 = line['x']; } @@ -57,6 +81,10 @@ function draw_line (line, id_div) { else { if (have_node_begin_img) { height = parseInt($('#' + line['node_begin'] + " img").css('height')); +<<<<<<< Updated upstream +======= + y1 = parseInt($('#' + line['node_begin']).css (selector + 'top')) + (height / 2) + img_pos_begin.top + img_margin_top_begin; +>>>>>>> Stashed changes } else { height = $('#' + line['node_begin']).height(); @@ -83,6 +111,10 @@ function draw_line (line, id_div) { else { if (have_node_end_img) { height = parseInt($('#' + line['node_end'] + " img").css('height')); +<<<<<<< Updated upstream +======= + y2 = parseInt($('#' + line['node_end']).css (selector + 'top')) + (height / 2) + img_pos_end.top + img_margin_top_end; +>>>>>>> Stashed changes } else { height = $('#' + line['node_end']).height(); From f58a9151f79b5b48c6f8493c2788b963ae60b7bb Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Mon, 22 May 2017 17:37:21 +0200 Subject: [PATCH 2/2] Fixed bad merge, thx branches --- .../include/javascript/pandora_visual_console.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/javascript/pandora_visual_console.js b/pandora_console/include/javascript/pandora_visual_console.js index 4200aeca66..35179636a0 100755 --- a/pandora_console/include/javascript/pandora_visual_console.js +++ b/pandora_console/include/javascript/pandora_visual_console.js @@ -38,8 +38,6 @@ function draw_line (line, id_div) { have_node_begin_img = $('#' + line['node_begin'] + " img").length; have_node_end_img = $('#' + line['node_end'] + " img").length; -<<<<<<< Updated upstream -======= if (have_node_begin_img) { var img_pos_begin = $('#' + line['node_begin'] + " img").position(); var img_margin_left_begin = $('#' + line['node_begin'] + " img").css("margin-left"); @@ -61,13 +59,13 @@ function draw_line (line, id_div) { img_margin_top_end = parseFloat(img_margin_top_end_aux[0]); } ->>>>>>> Stashed changes if (line['x1']) { x1 = line['x']; } else { if (have_node_begin_img) { width = $('#' + line['node_begin'] + " img").width(); + x1 = parseInt($('#' + line['node_begin']).css (selector + 'left')) + (width / 2) + img_pos_begin.left + img_margin_left_begin; } else { width = $('#' + line['node_begin']).width(); @@ -81,10 +79,7 @@ function draw_line (line, id_div) { else { if (have_node_begin_img) { height = parseInt($('#' + line['node_begin'] + " img").css('height')); -<<<<<<< Updated upstream -======= y1 = parseInt($('#' + line['node_begin']).css (selector + 'top')) + (height / 2) + img_pos_begin.top + img_margin_top_begin; ->>>>>>> Stashed changes } else { height = $('#' + line['node_begin']).height(); @@ -98,6 +93,7 @@ function draw_line (line, id_div) { else { if (have_node_end_img) { width = $('#' + line['node_end'] + " img").width(); + x2 = parseInt($('#' + line['node_end']).css (selector + 'left')) + (width / 2) + img_pos_end.left + img_margin_left_end; } else { width = $('#' + line['node_end']).width(); @@ -111,10 +107,7 @@ function draw_line (line, id_div) { else { if (have_node_end_img) { height = parseInt($('#' + line['node_end'] + " img").css('height')); -<<<<<<< Updated upstream -======= y2 = parseInt($('#' + line['node_end']).css (selector + 'top')) + (height / 2) + img_pos_end.top + img_margin_top_end; ->>>>>>> Stashed changes } else { height = $('#' + line['node_end']).height();