mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-29 10:55:43 -05:00
Fix: Enable Select2 dropdowns inside modals on Transfer Server (Search functionality now working) (#5590)
closes #5588
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user