Interfaces Other Types - Dynamic Options (#5300)

A more deterministic direct approach that won't break with changing or differing ancestry depths.
Also cleaner and clearer than .parent().parent().
This commit is contained in:
NOYB 2021-10-22 00:35:40 -07:00 committed by GitHub
parent f673ee396c
commit f76691b984
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,9 +186,9 @@ legacy_html_escape_form_data($pconfig);
$( document ).ready(function() {
$("#proto").change(function(){
let this_proto = $("#proto").val();
$(".proto").parent().parent().hide();
$(".proto").closest('tr').hide();
$(".proto").prop( "disabled", true );
$(".proto_"+this_proto).parent().parent().show();
$(".proto_"+this_proto).closest('tr').show();
$(".proto_"+this_proto).prop( "disabled", false );
$('.selectpicker').selectpicker('refresh');
});