Merge branch 'spidev' into 'master'

Pops Bugfix

See merge request fronk/thetool!1865
This commit is contained in:
Daniel Spitzer
2025-11-04 12:19:27 +00:00
3 changed files with 32 additions and 12 deletions
+25 -6
View File
@@ -28,7 +28,7 @@ $(document).ready(function () {
var thisclick = $(event.relatedTarget);
var rackhe = thisclick.closest('table').find('th').data('rackhe');
var rackid = thisclick.closest('table').find('th').data('rackid');
var rackname = $.trim(thisclick.closest('table').find('th').text());
var rackname = thisclick.closest('table').find('th').data('rackname');
var minhe = 1;
var modal = $(this);
var edit = 0;
@@ -74,6 +74,8 @@ $(document).ready(function () {
modal.find('.modal-title').html('<span id="module-info">Modul (' + destinationname + ')</span>');
modal.find('.alert').text('');
modal.find('.alert').hide();
$('#module-slot-div').hide();
$('#module-position-div').hide();
var options;
var selected;
var hemaxcount = 1;
@@ -96,23 +98,40 @@ $(document).ready(function () {
if (parent.find('td').eq(1).data('id') || parent.find('td').eq(2).data('id') || parent.find('td').eq(3).data('id') || parent.find('td').eq(4).data('id')) {
var counttd = parent.find('td').length - 1;
var newmodule = false;
if (counttd > 1) {
var modwidth;
var totalPositions;
if (parent.find('td').eq(1).data('width')) {
modwidth = parent.find('td').eq(1).data('width');
totalPositions = 12 / modwidth;
} else {
modwidth = 12 / counttd;
totalPositions = counttd;
}
$('#module-width').val(modwidth);
if (totalPositions > 1) {
var options;
for (let i = 1; i <= counttd; i++) {
for (let i = 1; i <= totalPositions; i++) {
options = options + '<option value="' + i + '">' + i + '</option>';
}
$('#module-slot').html(options);
$('#module-position').html(options);
$('#module-slot-div').show();
}
else
{
}
$('#module-width').attr('disabled', 'disabled');
$('#he-count-div').html(`<select required="required" id="module-he-count" name="module-he-count" class="form-control" disabled="disabled"><option value="` + parent.find('td').eq(1).attr('rowspan') + `">` + parent.find('td').eq(1).attr('rowspan') + `</option><select>`);
$('#he-start-div').html(`<select required="required" id="module-he-start" name="module-he-start" class="form-control" disabled="disabled"><option value="` + parent.find('td').eq(0).data('he') + `">` + parent.find('td').eq(0).data('he') + `</option></select>`);
if (parent.find('td').eq(1).data('id') === undefined) {
newmodule = true;
}
var modwidth = 12 / counttd;
$('#module-width').val(modwidth);
if (!newmodule) {
$('#module-remove').show();
@@ -133,7 +152,7 @@ $(document).ready(function () {
}
$('#module-name').val(parent.find('td').eq(1).data('name'));
const status = parent.find('td').eq(1).data('status');
$('#module-type').val(parent.find('td').eq(1).data('type')).change(); // .change() ist hier wichtig!
$('#module-type').val(parent.find('td').eq(1).data('type')).change();
$('#module-status').val(status);
$('#module-type option[value="1"]').prop('disabled', true);