Skip to content

Commit

Permalink
Fixes #37186 - webpack 5 adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaAga authored and nofaralfasi committed Jul 16, 2024
1 parent 7eebea6 commit fa4762b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 27 deletions.
44 changes: 23 additions & 21 deletions app/views/discovered_hosts/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -96,28 +96,30 @@
</div>
</div>

<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("table").css('padding', '0');
$("table").css("cssText", 'margin-bottom: 0 !important;');
<% content_for(:javascripts) do -%>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("table").css('padding', '0');
$("table").css("cssText", 'margin-bottom: 0 !important;');

provision_class = 'active'
primary_class = 'active'
var flag_primary = '<i class="glyphicon glyphicon glyphicon-tag primary-flag '+ primary_class +'" title="" data-original-title="'+ __('Primary') +'"></i>';
var flags_provision = '<i class="glyphicon glyphicon glyphicon-hdd provision-flag '+ provision_class +'" title="" data-original-title="'+ __('Provisioning') +'"></i>';
provision_class = 'active'
primary_class = 'active'
var flag_primary = '<i class="glyphicon glyphicon glyphicon-tag primary-flag '+ primary_class +'" title="" data-original-title="'+ __('Primary') +'"></i>';
var flags_provision = '<i class="glyphicon glyphicon glyphicon-hdd provision-flag '+ provision_class +'" title="" data-original-title="'+ __('Provisioning') +'"></i>';

$('.flag-primary').html(flag_primary);
$('.flag-provision').append(flags_provision);
$('.primary-flag').tooltip();
$('.provision-flag').tooltip();
$('.flag-primary').html(flag_primary);
$('.flag-provision').append(flags_provision);
$('.primary-flag').tooltip();
$('.provision-flag').tooltip();

expand_all_toggle_action = { 'Expand All': 'show', 'Collapse All': 'hide' };
$('#expand_all').on('click', function () {
$(this).text(function(i, text){
$('#accordion .panel-collapse').collapse(expand_all_toggle_action[text]);
return text === "Expand All" ? "Collapse All" : "Expand All";
})
});
expand_all_toggle_action = { 'Expand All': 'show', 'Collapse All': 'hide' };
$('#expand_all').on('click', function () {
$(this).text(function(i, text){
$('#accordion .panel-collapse').collapse(expand_all_toggle_action[text]);
return text === "Expand All" ? "Collapse All" : "Expand All";
})
});

});
</script>
});
</script>
<% end %>
6 changes: 0 additions & 6 deletions app/views/discovery_rules/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,3 @@
</div>
<%= submit_or_cancel f %>
<% end %>

<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('input.counter_spinner').spinner();
});
</script>

0 comments on commit fa4762b

Please sign in to comment.