mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-19 22:41:55 +00:00
Merge pull request #339 from LD-Reborn/254-bug-print-batch-element-delete-button-too-close-to-updown-buttons
Fixed print batch delete element button too close to up and down buttons
This commit is contained in:
@@ -67,7 +67,7 @@
|
||||
const asset = json.assetsModel;
|
||||
assetCard.innerHTML = `
|
||||
<div class="card-body" data-cn="${asset.Cn}">
|
||||
<h4 class="card-title"><strong>Asset ${i + 1}:</strong> ${asset.Name}</h4>
|
||||
<h4 class="card-title mb-4" style="text-align: center;"><button class="btn btn-sm btn-danger" data-action="remove" data-batchid="${i}" style="float:left;">X</button><strong>Asset ${i + 1}:</strong> ${asset.Name}</h4>
|
||||
<div class="row">
|
||||
<div class="col-md-5">
|
||||
<p><strong>@T["Asset ID"]:</strong> ${asset.Cn}</p>
|
||||
@@ -87,7 +87,7 @@
|
||||
} else {
|
||||
assetCard.innerHTML = `
|
||||
<div class="card-body">
|
||||
<h4 class="card-title"><strong>Asset ${i + 1}:</strong> @T["Empty"]</h4>
|
||||
<h4 class="card-title mb-4" style="text-align: center;"><button class="btn btn-sm btn-danger" data-action="remove" data-batchid="${i}" style="float:left;">X</button><strong>Asset ${i + 1}:</strong> @T["Empty"]</h4>
|
||||
<div class="row">
|
||||
<div id="printPreviewBatchButtons${i}" class="col-md-1 justify-content-end" style="margin-left: auto; width: auto;">
|
||||
</div>
|
||||
@@ -108,17 +108,12 @@
|
||||
downButton.setAttribute('data-batchId', i);
|
||||
downButton.className = 'btn btn-sm btn-primary';
|
||||
downButton.textContent = '↓';
|
||||
let removeButton = document.createElement('button');
|
||||
removeButton.setAttribute('data-action', 'remove');
|
||||
removeButton.setAttribute('data-batchId', i);
|
||||
removeButton.className = 'btn btn-sm btn-danger';
|
||||
removeButton.innerHTML = 'X';
|
||||
let removeButton = document.querySelector(`button.btn-danger[data-batchid="${i}"]`);
|
||||
|
||||
container.appendChild(upButton);
|
||||
container.appendChild(document.createElement('br'));
|
||||
container.appendChild(downButton);
|
||||
container.appendChild(document.createElement('br'));
|
||||
container.appendChild(removeButton);
|
||||
upButton.addEventListener('click', function() {
|
||||
moveCardInBatch(upButton.parentElement.parentElement.parentElement.parentElement.attributes["data-card-index"].value, "up");
|
||||
});
|
||||
@@ -241,10 +236,10 @@
|
||||
|
||||
let cardAtIndex = document.querySelector(`[data-card-index="${index}"]`)
|
||||
let cardBodyAtIndex = cardAtIndex.children[0];
|
||||
cardBodyAtIndex.children[0].children[0].textContent = `Asset ${newIndex + 1}`;
|
||||
cardBodyAtIndex.children[0].children[1].textContent = `Asset ${newIndex + 1}`;
|
||||
let cardAtTarget = document.querySelector(`[data-card-index="${newIndex}"]`)
|
||||
let cardBodyAtTarget = cardAtTarget.children[0];
|
||||
cardBodyAtTarget.children[0].children[0].textContent = `Asset ${index - 0 + 1}`;
|
||||
cardBodyAtTarget.children[0].children[1].textContent = `Asset ${index - 0 + 1}`;
|
||||
cardAtIndex.insertBefore(cardBodyAtTarget, null);
|
||||
cardAtTarget.insertBefore(cardBodyAtIndex, null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user