From 8b83b94a40442de94eb696907cc0d2efa278f0bc Mon Sep 17 00:00:00 2001 From: enriquecd Date: Wed, 14 Jun 2017 16:59:59 +0200 Subject: [PATCH] Change vconsole label editor background color when rightclick on it - #984 --- .../visual_console_builder.editor.js | 25 ++++++++++++++++++- .../include/functions_visual_map_editor.php | 6 ++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 229ceeaa86..4926a215ca 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -84,6 +84,28 @@ function visual_map_main() { //Fixed to wait the load of images. $(window).load(function() { + + // Begin - Background label color changer + + $( "#text-label_ifr" ).contents().find( "body" ).bind("contextmenu", function(e) { + e.preventDefault(); + }); + + $( "#text-label_ifr" ).contents().find( "body" ).mousedown(function(e){ + if(e.which == 3) + { + if($( "#text-label_ifr" ).contents().find( "body" ).css('background-color') == 'rgb(211, 211, 211)'){ + $( "#text-label_ifr" ).contents().find( "body" ).css('background-color','white'); + } + else{ + $( "#text-label_ifr" ).contents().find( "body" ).css('background-color','lightgray'); + } + + } + }); + + // End - Background label color changer + $('#radiobtn0001').click(function(){ $("#custom_graph option[value=0]").prop("selected", true); }); @@ -930,7 +952,8 @@ function toggle_item_palette() { }); $( "#text-label_ifr" ).contents().find( "p" ).css("line-height",$('#lineheight').val()); - $( "#text-label_ifr" ).contents().find( "span" ).css("line-height",$('#lineheight').val()); + $( "#text-label_ifr" ).contents().find( "span" ).css("line-height",$('#lineheight').val()); + $( "#text-label_ifr" ).contents().find( "body" ).css("background","lightgray"); } } diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 83f7c99a81..421fe26bd2 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -186,7 +186,11 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { ' . - html_print_input_text('label', '', '', 20, 200, true) . ''; + html_print_input_text('label', '', '', 20, 200, true) . ' + + '.__("Click right mouse button to change background label editor color").' + + '; $form_items['image_row'] = array();