Project

General

Profile

« Previous | Next » 

Revision d94f4d36

Added by Shimon Shtein over 8 years ago

Fixes #12794 - Defined logic when properties should be sent to server

If hostgroup is not set - always send the parameters.
On hostgroup change - remove inherited parameters from the request, so the values from the hostgroup will take place.
On save - send the values according to the state of the "inherit" button.

View differences:

app/assets/javascripts/host_edit.js
reload_host_params();
}
} else { // a new host
reset_explicit_values(element);
set_inherited_value(element);
update_form(element);
}
}
function reset_explicit_values(element) {
$("[name=is_overridden_btn]").each(function(i, btn) {
var item = $(btn)
item.attr('data-explicit', false);
})
}
function set_inherited_value(hostgroup_elem) {
var had_hostgroup = $(hostgroup_elem).data("had-hostgroup")
......
if (element.nextSibling.children == undefined) return true;
if (element.nextSibling.children[0] == undefined) return true;
if (element.nextSibling.children[0].dataset == undefined) return true;
if (element.nextSibling.children[0].dataset.explicit == undefined) return true;
return element.nextSibling.children[0].dataset.explicit == 'true';
}

Also available in: Unified diff