Hi all,
I'm working on katello issue #6565 - Only hide the media drop down if a valid kickstart url can be calculated without one
The idea is this:
- After the following are selected
- Lifecycle environment
- Content view
- Content source
- Architecture
- Operating system
-
Calculate kickstart url based on 5 select boxes above.
-
If kickstart url can be calculated, show it instead of Foreman's Media select box. Otherwise, keep Foreman's Media select box
The challenge is this:
- operating system select box currently has :onchange => 'os_selected(this);' with called function reload_host_params which reloads the whole form in Ajax.
- reload_host_params discards any changes I made to hide the media select box and show the kickstart_url
Any ideas how to preserve the changes already made in the DOM by the katello plugin?
There are two other issues that I'm trying to debug that I encountered
- Bug #6940: Ajax 404 error on new host form if operating system is changed to blank value - Foreman - Ajax 404 error on new host form if operating system is changed to blank value
As a result, the media select box is not shown again as it should have been.
- function toggle_installation_medium() is being called 3 times
$(document).on('ContentLoad', function(){onKatelloHostEditLoad()});
function onKatelloHostEditLoad(){
$('#host_operatingsystem_id').live('change', function() {
toggle_installation_medium();
});
$('#host_content_source_id').live('change', function() {
toggle_installation_medium();
});
}
Thanks,
Joseph