Merge branch '836-fixed-margin-top-images-in-vc-lines-open-dev' into 'develop'

Added margin top value to images when have lines

See merge request !496
This commit is contained in:
vgilc 2017-05-22 17:45:57 +02:00
commit 50420f79b9
1 changed files with 10 additions and 2 deletions

View File

@ -42,12 +42,20 @@ function draw_line (line, id_div) {
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]);
}
if (line['x1']) {
@ -71,7 +79,7 @@ function draw_line (line, id_div) {
else {
if (have_node_begin_img) {
height = parseInt($('#' + line['node_begin'] + " img").css('height'));
y1 = parseInt($('#' + line['node_begin']).css (selector + 'top')) + (height / 2) + img_pos_begin.top;
y1 = parseInt($('#' + line['node_begin']).css (selector + 'top')) + (height / 2) + img_pos_begin.top + img_margin_top_begin;
}
else {
height = $('#' + line['node_begin']).height();
@ -99,7 +107,7 @@ function draw_line (line, id_div) {
else {
if (have_node_end_img) {
height = parseInt($('#' + line['node_end'] + " img").css('height'));
y2 = parseInt($('#' + line['node_end']).css (selector + 'top')) + (height / 2) + img_pos_end.top;
y2 = parseInt($('#' + line['node_end']).css (selector + 'top')) + (height / 2) + img_pos_end.top + img_margin_top_end;
}
else {
height = $('#' + line['node_end']).height();