From d290d69d335c6bfd7395a7bf5d869ba413c74854 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Fri, 8 Sep 2017 11:15:29 +0200 Subject: [PATCH] Now the label editor color is changed by the mouse scroll - #1103 --- .../visual_console_builder.editor.js | 24 +++++++------------ .../include/functions_visual_map_editor.php | 2 +- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 3cea48be21..ce58217ccb 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -126,23 +126,17 @@ function visual_map_main() { // Begin - Background label color changer - $( "#text-label_ifr" ).contents().find( "body" ).bind("contextmenu", function(e) { - e.preventDefault(); + $( "#text-label_ifr" ).contents().find( "body" ).bind('mousewheel', function(e){ + e.preventDefault(); + + 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'); + } }); - $( "#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(){ diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index c0c261ea57..7ef82de44d 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -189,7 +189,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { ' . html_print_input_text('label', '', '', 20, 200, true) . ' - '.__("Click right mouse button to change the background color of the label editor").' + '.__("Scroll the mouse wheel over the label editor to change the background color").' ';