Commit b7d1af0c authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(ui) select highest visible option in hook_ipv4v6

(cherry picked from commit ebe341ec)
parent a7988481
...@@ -45,13 +45,16 @@ function hook_ipv4v6(classname, data_id) { ...@@ -45,13 +45,16 @@ function hook_ipv4v6(classname, data_id) {
} else { } else {
$(this).removeClass('hidden'); $(this).removeClass('hidden');
} }
}).promise().done(function(){ });
// select highest visible option
if (parseInt($("#"+selectlist_id).val()) > 32 && itemValue.indexOf(":") == -1) {
$("#"+selectlist_id+' option[value=32]').attr('selected','selected');
}
// when select list uses selectpicker, refresh // when select list uses selectpicker, refresh
if ($("#"+selectlist_id).hasClass('selectpicker')) { if ($("#"+selectlist_id).hasClass('selectpicker')) {
$("#"+selectlist_id).selectpicker('refresh'); $("#"+selectlist_id).selectpicker('refresh');
} }
}); });
});
} }
// trigger initial onChange event // trigger initial onChange event
$("#"+$(this).data(data_id)).change(); $("#"+$(this).data(data_id)).change();
......
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