Prevent removing row even if not original row
This commit is contained in:
parent
b04d4b12df
commit
389bf932ae
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "dice",
|
"name": "dice",
|
||||||
"version": "1.0.16",
|
"version": "1.0.17",
|
||||||
"description": "Calculates the probability of rolling a value given a combination of dice.",
|
"description": "Calculates the probability of rolling a value given a combination of dice.",
|
||||||
"author": "F.W. Dekker",
|
"author": "F.W. Dekker",
|
||||||
"browser": "dist/bundle.js",
|
"browser": "dist/bundle.js",
|
||||||
|
|
|
@ -126,7 +126,7 @@ inputTable.addDieRow = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
inputTable.removeDieRow = index => {
|
inputTable.removeDieRow = index => {
|
||||||
if (inputTable.highestDieRowIndex() > 0) {
|
if (inputTable.dieRowCount() > 1) {
|
||||||
const table = inputTable.getTable();
|
const table = inputTable.getTable();
|
||||||
const row = table.querySelector("tr[data-index=\"" + index + "\"]");
|
const row = table.querySelector("tr[data-index=\"" + index + "\"]");
|
||||||
row.parentElement.removeChild(row);
|
row.parentElement.removeChild(row);
|
||||||
|
|
Loading…
Reference in New Issue