mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-02 17:25:05 +02:00
Fixed issue with removing the bom entries caused by the multiple collapse rows
This commit is contained in:
parent
a3ee51e76b
commit
39ed00c7c0
6 changed files with 83 additions and 40 deletions
|
@ -26,6 +26,7 @@ export default class extends Controller {
|
|||
static values = {
|
||||
deleteMessage: String,
|
||||
prototype: String,
|
||||
rowsToDelete: Number, //How many rows (including the current one) shall be deleted after the current row
|
||||
}
|
||||
|
||||
static targets = ["target"];
|
||||
|
@ -125,7 +126,17 @@ export default class extends Controller {
|
|||
const del = () => {
|
||||
const target = event.target;
|
||||
//Remove the row element from the table
|
||||
target.closest("tr").remove();
|
||||
const current_row = target.closest("tr");
|
||||
for(let i = this.rowsToDeleteValue; i > 1; i--) {
|
||||
let nextSibling = current_row.nextElementSibling;
|
||||
//Ensure that nextSibling is really a tr
|
||||
if (nextSibling && nextSibling.tagName === "TR") {
|
||||
nextSibling.remove();
|
||||
}
|
||||
}
|
||||
|
||||
//Finally delete the current row
|
||||
current_row.remove();
|
||||
}
|
||||
|
||||
if(this.deleteMessageValue) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue