fixed rm lvl's update legend bug

This commit is contained in:
realaravinth 2021-05-30 12:18:27 +05:30
parent f448f28d01
commit 2c5dbc7c5f
No known key found for this signature in database
GPG key ID: AD9F0F08E855ED88
4 changed files with 9 additions and 4 deletions

View file

@ -44,6 +44,7 @@ $footer-font-size: 14px;
.details__item {
margin: auto 10px;
list-style: none;
}
.details__link {

View file

@ -28,12 +28,14 @@
.taskbar__action {
display: inline-block;
list-style: none;
padding: 10px 0px;
margin: auto;
}
.taskbar__spacer {
min-width: 250px;
list-style: none;
flex: 6;
}

View file

@ -62,6 +62,7 @@
.secondary-menu__item {
margin: auto;
list-style: none;
padding: 20px 25px;
display: flex;
}

View file

@ -53,11 +53,12 @@ const updateLevelNumbersOnDOM = (id: number) => {
}
// rename legend
const legend = levelGroup.getElementsByTagName('legend')[0];
const legendText = document.createTextNode(`Level ${newLevel}`);
levelGroup.getElementsByTagName(
'legend',
)[0].appendChild(legendText);
const newLegend = document.createElement('legend');
newLegend.className = legend.className;
newLegend.appendChild(legendText);
legend.replaceWith(newLegend);
// rename labels
updateLabels(levelGroup, newLevel);