2012-09-11 Sergio Martin <sergio.martin@artica.es>

* include/javascript/pandora_modules.js: Fixed the reset of the
	form of local modules after select a module component and
	unselect it



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6952 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2012-09-11 10:51:23 +00:00
parent de474a11b1
commit acce7617fa
2 changed files with 39 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2012-09-11 Sergio Martin <sergio.martin@artica.es>
* include/javascript/pandora_modules.js: Fixed the reset of the
form of local modules after select a module component and
unselect it
2012-09-10 Miguel de Dios <miguel.dedios@artica.es>
* general/header.php: fixed the link to logout when the Pandora

View File

@ -23,8 +23,10 @@ function configure_modules_form () {
var $select = $("#local_component").hide ();
$("#component").hide ();
if (this.value == 0)
if (this.value == 0) {
reset_data_module_form();
return;
}
$("#component_loading").show ();
$(".error, #no_component").hide ();
$("option[value!=0]", $select).remove ();
@ -56,10 +58,39 @@ function configure_modules_form () {
}
);
function reset_data_module_form() {
// Delete macro fields
$('.macro_field').remove();
// Hide show/hide configuration data switch
$('#simple-show_configuration_data').hide();
$('#simple-hide_configuration_data').hide();
$('#configuration_data_legend').hide();
$("#textarea_configuration_data").val('');
$('#simple-configuration_data').show();
$("#text-name").val('');
$("#textarea_description").val('');
$("#checkbox-history_data").check ();
$("#text-max").attr ("value", "");
$("#text-min").attr ("value", "");
$("#text-min_warning").attr ("value", 0);
$("#text-max_warning").attr ("value", 0);
$("#text-str_warning").attr ("value", '');
$("#text-min_critical").attr ("value", 0);
$("#text-max_critical").attr ("value", 0);
$("#text-str_critical").attr ("value", '');
$("#text-ff_event").attr ("value", 0);
$("#text-post_process").attr("value", 0);
$("#text-unit").attr("value", '');
}
$("#local_component").change (function () {
if (this.value == 0)
if (this.value == 0) {
reset_data_module_form();
return;
}
$("#component_loading").show ();
$(".error").hide ();
jQuery.post ("ajax.php",