Skip to content

Commit

Permalink
Fixes #38223 - host_edit when no inherit button creates error
Browse files Browse the repository at this point in the history
(cherry picked from commit c97a40e)
  • Loading branch information
MariaAga authored and ofedoren committed Feb 20, 2025
1 parent 0466b03 commit 1a4bf20
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/assets/javascripts/host_edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ $(document).ready(function() {
});
$(document).on('ContentLoad', function() {
onHostEditLoad();
document
.querySelector('[name=is_overridden_btn]')
.addEventListener('click', function(event) {
const overrideButtons = document.querySelectorAll('[name=is_overridden_btn]');
overrideButtons.forEach(button =>
button.addEventListener('click', function(event) {
const item = event.target;
var formControl = $(item)
.closest('.input-group')
Expand All @@ -26,7 +26,8 @@ $(document).on('ContentLoad', function() {
.trigger('change');
}
}
});
})
);
if (window.location.href.includes('hostgroup')) {
document.querySelector('form').addEventListener('submit', function() {
// making sure inherited compute resource is included in the form
Expand Down

0 comments on commit 1a4bf20

Please sign in to comment.