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/assets/javascripts/host_edit.js
$('#compute_resource_tab a').addClass('tab-error');
},
success: function(result){
$('#compute_resource').html(result).find('select:not(without_select2)').select2();
$('#compute_resource').html(result);
activate_select2('#compute_resource');
if ($('#compute_resource').find('.alert-danger').length > 0) $('#compute_resource_tab a').addClass('tab-error');
update_capabilities($('#capabilities').val());
}
......
subnet_options.attr('disabled', true);
}
reloadOnAjaxComplete(element);
subnet_options.filter('select').select2({allowClear: true})
activate_select2(subnet_options);
}
});
}
......
request.done(function() {
password_caps_lock_hint();
$("#interfaceModal").find('a[rel="popover-modal"]').popover();
$('select:not(.without_select2)').select2({ allowClear: true });
activate_select2('#interfaceModal');
});
}

Also available in: Unified diff