Project

General

Profile

« Previous | Next » 

Revision b70d83c4

Added by Dominic Cleal about 8 years ago

fixes #14041 - don't call select2 on CR form templates

select2 must be called only when the select becomes visible, not for
hidden template elements. add_child_node() already does when adding a
new set of fields from the template. without_select2 is removed from
all CR volume fields and a typo from ce59b508 fixed to ensure the first,
default volume initialises select2 when a CR is selected.

The interface_type_selected function is fixed to only call select2 on
its elements instead of the entire page, which also broke the volume
form templates if a NIC type was changed.

(cherry picked from commit 26eeda8011cf1c16be9446625b201c36ebe70751)

View differences:

app/views/compute_resources_vms/form/ovirt/_volume.html.erb
<%= text_f f,:size_gb, :label => _('Size (GB)'), :label_size => "col-md-2", :disabled => !new_host, :class => "col-md-2" %>
<%= f.hidden_field :size_gb if !new_host %>
<%= select_f f, :storage_domain, compute_resource.storage_domains, :id, :name,
{ }, :label => _('Storage domain'), :label_size => "col-md-2", :disabled => !new_host, :class => "col-md-2 without_select2" %>
{ }, :label => _('Storage domain'), :label_size => "col-md-2", :disabled => !new_host, :class => "col-md-2" %>
<%= f.hidden_field :storage_domain if !new_host %>
<%= f.hidden_field :id %>

Also available in: Unified diff