From b0b57fdb2c7effea4df6737bb496a638029c7015 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 6 Nov 2014 16:43:45 +0100 Subject: [PATCH] Fixed the javascript for hide the dinamic macros with this property setted. TICKET #1545 (cherry picked from commit 1fdcacf29f9c07cde34b84f46ca9ee12178fbf00) --- .../include/javascript/pandora_modules.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index 94b9b0d549..87d995529d 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -630,7 +630,23 @@ function add_macro_field(macro, row_model_id) { // Change the text box id and value $('#'+row_id).children().eq(1).children().attr('id','text-'+macro_macro); $('#'+row_id).children().eq(1).children().attr('name',macro_macro); - if (macro['hide']) { + + macro_field_hide = false; + if (typeof(macro['hide']) == "string") { + if (macro['hide'].length == 0) { + macro_field_hide = false; + } + else { + if (parseInt(macro['hide'])) { + macro_field_hide = true; + } + else { + macro_field_hide = false; + } + } + } + + if (macro_field_hide) { $('#'+row_id).children().eq(1).children().attr('type','password'); } $('#'+row_id).children().eq(1).children().val(macro_value);