Skip to content

Commit 2fd2160

Browse files
committed
Updated the todo list to fix the activate and replace issue
1 parent 1da2d03 commit 2fd2160

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Fritz.StreamTools/Pages/ToDo.cshtml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
this.Replace = function (id, text) {
127127
var el = document.querySelectorAll(`li[data-id='${id}'] > i`);
128128
var regEx = /\s\d+\..*/g;
129-
for (var e in el) {
129+
for (var e of el) {
130130
e.innerHTML = e.innerHTML.replace(regEx, ` ${id}. ${text}`);
131131
}
132132
@@ -141,8 +141,9 @@
141141
this.Activate = function (id) {
142142
Deactivate();
143143
var el = document.querySelectorAll(`li[data-id='${id}']`);
144-
el[0].classList.add("active");
145-
if (el.length > 1) el[1].classList.remove("active");
144+
for (var e of el) {
145+
e.classList.add("active");
146+
}
146147
}
147148
148149
this.Deactivate = function () {

0 commit comments

Comments
 (0)