From 7763e8fa39468ac324faa3bc7207f4818685e36e Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 30 Apr 2024 08:23:51 +0200 Subject: [PATCH] #13517 autocomplete param size --- .../reporting/reporting_builder.item_editor.php | 2 ++ pandora_console/include/functions_ui.php | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 945739bc74..cd53da1f95 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -2318,7 +2318,9 @@ if (is_metaconsole() === true) { $params['add_none_module'] = true; $params['use_hidden_input_idagent'] = true; $params['hidden_input_idagent_id'] = 'hidden-id_agent'; + $params['size'] = 40; if ($meta) { + $params['size'] = 44; $params['use_input_id_server'] = true; $params['input_id_server_id'] = 'hidden-server_id'; $params['metaconsole_enabled'] = true; diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 89e8c2d01b..7b08ae2bbf 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -5867,7 +5867,7 @@ function ui_print_agent_autocomplete_input($parameters) $hidden_input_idagent_value = $parameters['hidden_input_idagent_value']; } - $size = 30; + $size = 100; // Default value. if (isset($parameters['size'])) { $size = $parameters['size']; @@ -6293,14 +6293,14 @@ function ui_print_agent_autocomplete_input($parameters) $javascript_function_change .= ' function setInputBackground(inputId, image) { $("#"+inputId) - .attr("style", "background-image: url(\'"+image+"\'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$inputStyles.'"); + .attr("style", "background-image: url(\'"+image+"\'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:'.$size.'%; '.$inputStyles.'"); } $(document).ready(function () { $("#'.$input_id.'").focusout(function (e) { setTimeout(() => { let iconImage = "'.$icon_image.'"; - $("#'.$input_id.'").attr("style", "background-image: url(\'"+iconImage+"\'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$inputStyles.'"); + $("#'.$input_id.'").attr("style", "background-image: url(\'"+iconImage+"\'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:'.$size.'%; '.$inputStyles.'"); }, 100); }); }); @@ -6574,7 +6574,7 @@ function ui_print_agent_autocomplete_input($parameters) if (select_item_click) { select_item_click = 0; $("#'.$input_id.'") - .attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$inputStyles.'"); + .attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:'.$size.'%; '.$inputStyles.'"); return; } else { // Clear selectbox if item is not selected. @@ -6589,7 +6589,7 @@ function ui_print_agent_autocomplete_input($parameters) //Set loading $("#'.$input_id.'") - .attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$inputStyles.'"); + .attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:'.$size.'%; '.$inputStyles.'"); var term = input_value; //Word to search '.$javascript_change_ajax_params_text.' @@ -6606,7 +6606,7 @@ function ui_print_agent_autocomplete_input($parameters) success: function (data) { if (data.length < 2) { //Set icon - $("#'.$input_id.'").attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$inputStyles.'"); + $("#'.$input_id.'").attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:'.$size.'%; '.$inputStyles.'"); return; } @@ -6656,7 +6656,7 @@ function ui_print_agent_autocomplete_input($parameters) //Set icon $("#'.$input_id.'") - .attr("style", "background: url(\"'.$icon_image.'\") 97% center no-repeat; background-size: 20px; width:100%; '.$inputStyles.'") + .attr("style", "background: url(\"'.$icon_image.'\") 97% center no-repeat; background-size: 20px; width:'.$size.'%; '.$inputStyles.'") return; } }); @@ -6675,7 +6675,7 @@ function ui_print_agent_autocomplete_input($parameters) } $attrs = []; - $attrs['style'] = 'background-image: url('.$icon_image.'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$text_color.' '.$inputStyles.''; + $attrs['style'] = 'background-image: url('.$icon_image.'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:'.$size.'%; '.$text_color.' '.$inputStyles.''; if (!$disabled_javascript_on_blur_function) { $attrs['onblur'] = $javascript_on_blur_function_name.'()';