Fix: Enable Select2 dropdowns inside modals on Transfer Server (Search functionality now working) (#5590)

closes #5588
This commit is contained in:
VoidValue
2026-03-26 16:23:34 -07:00
committed by GitHub
parent c40f68e48a
commit 62aab79689
@@ -1,25 +1,32 @@
$(document).ready(function () {
const $modal = $('#transferServerModal');
$('#pNodeId').select2({
placeholder: 'Select a Node',
dropdownParent: $modal,
}).change();
$('#pAllocation').select2({
placeholder: 'Select a Default Allocation',
dropdownParent: $modal,
});
$('#pAllocationAdditional').select2({
placeholder: 'Select Additional Allocations',
dropdownParent: $modal,
});
});
$('#pNodeId').on('change', function () {
let currentNode = $(this).val();
const $modal = $('#transferServerModal');
$.each(Pterodactyl.nodeData, function (i, v) {
if (v.id == currentNode) {
$('#pAllocation').html('').select2({
data: v.allocations,
placeholder: 'Select a Default Allocation',
dropdownParent: $modal,
});
updateAdditionalAllocations();
@@ -34,6 +41,7 @@ $('#pAllocation').on('change', function () {
function updateAdditionalAllocations() {
let currentAllocation = $('#pAllocation').val();
let currentNode = $('#pNodeId').val();
const $modal = $('#transferServerModal');
$.each(Pterodactyl.nodeData, function (i, v) {
if (v.id == currentNode) {
@@ -50,6 +58,7 @@ function updateAdditionalAllocations() {
$('#pAllocationAdditional').html('').select2({
data: allocations,
placeholder: 'Select Additional Allocations',
dropdownParent: $modal,
});
}
});