From 61ecef9ef900fa014d5a8712f2a85a180891f841 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 26 Nov 2014 15:33:07 +0100 Subject: [PATCH] Working in the new elements for the visualmap. Ticket #1478 --- .../visual_console_builder.editor.js | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 1b00dac721..619d91df33 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -388,6 +388,21 @@ function create_button_palette_callback() { } } +function delete_user_line(idElement) { + var found = null; + + jQuery.each(user_lines, function(iterator, user_line) { + if (user_line['id'] == idElement) { + found = iterator; + return; + } + }); + + if (found != null) { + user_lines.splice(found, 1); + } +} + function update_user_line(type, idElement, top, left) { jQuery.each(user_lines, function(iterator, user_line) { @@ -2127,9 +2142,22 @@ function deleteDB(idElement) { lines.splice(i, 1); } }); + + if ($("#handler_start_" + idElement).length || + $("#handler_end_" + idElement).length) { + + // Line item + + $("#handler_start_" + idElement).remove(); + $("#handler_end_" + idElement).remove(); + + delete_user_line(idElement); + } + + refresh_lines(lines, 'background', true); - + draw_user_lines("", 0, 0, 0 , 0, 0, true); $('#' + idElement).remove(); activeToolboxButton('delete_item', false);