Fix reseting scase

This commit is contained in:
Benjamin Renard 2024-09-22 19:09:41 +02:00
parent 942d39d755
commit 9694fafbcd
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC

View file

@ -262,12 +262,9 @@ function SCase(uuid, name, data) {
this.reset = function () { this.reset = function () {
this.cats.each(function (idx, cat) { this.cats.each(function (idx, cat) {
for (idx in cat.things) { for (idx in cat.things) {
if (cat.things[idx].checked) { cat.things[idx].reset();
cat.things[idx].checked = false;
}
} }
}); });
this.lastChange = new Date().getTime();
return true; return true;
}; };
@ -586,6 +583,11 @@ function Thing(uuid, label, nb, checked) {
this.removed = data.removed || false; this.removed = data.removed || false;
}; };
this.reset = function () {
this.checked = false;
this.lastChange = new Date().getTime();
};
this.export = function () { this.export = function () {
return { return {
uuid: this.uuid, uuid: this.uuid,