Skip to content

Commit

Permalink
Disable delete button if only one label is in table
Browse files Browse the repository at this point in the history
Relates: #30
  • Loading branch information
garfieldius committed May 22, 2024
1 parent e77eb06 commit 953f7ca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/js/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,14 @@ function setButtonVisiblity() {

if (index == 0) {
findOne("[data-toggle=moveUp]", row).classList.add("disabled");
} else if (index == max) {
}

if (index == max) {
findOne("[data-toggle=moveDown]", row).classList.add("disabled");
}

if (rows.length < 2) {
findOne("[data-toggle=remove]", row).classList.add("disabled");
}
});
}

0 comments on commit 953f7ca

Please sign in to comment.