fixed partstable

This commit is contained in:
2026-10-05 19:19:27 +02:00
parent 1293bcf4fd
commit 764cdade18
+24
View File
@@ -2743,6 +2743,28 @@ $(document).on("click", "#showHideImageBtn", function () {
return px; return px;
} }
// Riallinea larghezza e posizione delle tendine Select2 aperte nella tabella
function syncOpenSelect2() {
$("#partsTable select.select2-hidden-accessible").each(function () {
const inst = $(this).data("select2");
if (!inst || typeof inst.isOpen !== "function" || !inst.isOpen()) {
return;
}
const dd = inst.dropdown;
try {
if (dd && typeof dd._resizeDropdown === "function") {
dd._resizeDropdown();
}
if (dd && typeof dd._positionDropdown === "function") {
dd._positionDropdown();
}
} catch (e) {
// Se la versione di Select2 non lo supporta, chiude la tendina
inst.close();
}
});
}
function render() { function render() {
const n = getThs().length; const n = getThs().length;
if (!n || !getAvail()) return; if (!n || !getAvail()) return;
@@ -2754,6 +2776,8 @@ $(document).on("click", "#showHideImageBtn", function () {
.each(function (i) { .each(function (i) {
$(this).css("width", px[i] + "px"); $(this).css("width", px[i] + "px");
}); });
syncOpenSelect2();
} }
function addResizers() { function addResizers() {