Commit 48c5641f authored by Ad Schellevis's avatar Ad Schellevis

(legacy) missing change() event on proto select

parent 21418708
...@@ -594,20 +594,17 @@ include("head.inc"); ...@@ -594,20 +594,17 @@ include("head.inc");
if ($("#proto").val() == 'tcp' || $("#proto").val() == 'udp' || $("#proto").val() == 'tcp/udp') { if ($("#proto").val() == 'tcp' || $("#proto").val() == 'udp' || $("#proto").val() == 'tcp/udp') {
port_disabled = false; port_disabled = false;
} else { } else {
$("#dstbeginport optgroup:last option:first").prop('selected', true);
$("#dstendport optgroup:last option:first").prop('selected', true);
$("#srcbeginport optgroup:last option:first").prop('selected', true);
$("#srcendport optgroup:last option:first").prop('selected', true);
port_disabled = true; port_disabled = true;
} }
$("#srcbeginport").prop('disabled', port_disabled); var port_fields = ['srcbeginport', 'srcendport', 'dstbeginport', 'dstendport'];
$("#srcendport").prop('disabled', port_disabled); port_fields.forEach(function(field){
$("#dstbeginport").prop('disabled', port_disabled); if (port_disabled) {
$("#dstendport").prop('disabled', port_disabled); $("#"+field+" optgroup:last option:first").prop('selected', true);
$("#srcbeginport").selectpicker('refresh'); }
$("#srcendport").selectpicker('refresh'); $("#"+field).prop('disabled', port_disabled);
$("#dstbeginport").selectpicker('refresh'); $("#"+field).selectpicker('refresh');
$("#dstendport").selectpicker('refresh'); $("#"+field).change();
});
}); });
// IPv4 address, fix dstmask // IPv4 address, fix dstmask
...@@ -1076,7 +1073,7 @@ include("head.inc"); ...@@ -1076,7 +1073,7 @@ include("head.inc");
</table> </table>
</td> </td>
</tr> </tr>
<tr class="act_port_select"> <tr>
<td><a id="help_for_dstport" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Destination port range"); ?></td> <td><a id="help_for_dstport" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Destination port range"); ?></td>
<td> <td>
<table class="table table-condensed"> <table class="table table-condensed">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment