From 887a7fc858235675157f2ab68415a995992b629c Mon Sep 17 00:00:00 2001 From: buzz-lightsnack-2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Tue, 9 Apr 2024 09:09:57 +0800 Subject: [PATCH] amendment on the data handling thingy --- gui/scripts/windowman.JS | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gui/scripts/windowman.JS b/gui/scripts/windowman.JS index be0131b..160897e 100644 --- a/gui/scripts/windowman.JS +++ b/gui/scripts/windowman.JS @@ -513,11 +513,10 @@ export default class windowman { switch (ELEMENT[`type`]) { case `checkbox`: ELEMENT.checked = (DATA[`value`]); - + ELEMENT[`function`] = function() { DATA[`target`] = ((ELEMENT.getAttribute(`data-result-store`).split(`,`))[0] == ``) ? [...(ELEMENT.getAttribute(`data-result-store`).split(`,`).slice(1)), ...[NAME]] : [...AREA, ...[NAME], ...(ELEMENT.getAttribute(`data-result-store`).split(`,`))]; - DATA[`value`] = ELEMENT.checked; - secretariat.write(DATA[`target`], DATA[`value`], (ELEMENT.hasAttribute(`data-store-location`)) ? parseInt(ELEMENT.getAttribute(`data-store-location`)) : -1); + secretariat.write(DATA[`target`], ELEMENT.checked, (ELEMENT.hasAttribute(`data-store-location`)) ? parseInt(ELEMENT.getAttribute(`data-store-location`)) : -1); }; break; default: @@ -539,8 +538,7 @@ export default class windowman { ELEMENT[`function`] = function() { DATA[`target`] = ((ELEMENT.getAttribute(`data-result-store`).split(`,`))[0] == ``) ? [...(ELEMENT.getAttribute(`data-result-store`).split(`,`).slice(1)), ...[NAME]] : [...AREA, ...[NAME], ...(ELEMENT.getAttribute(`data-result-store`).split(`,`))]; - DATA[`value`] = ELEMENT.value.trim() - secretariat.write(DATA[`target`], DATA[`value`], (ELEMENT.hasAttribute(`data-store-location`)) ? parseInt(ELEMENT.getAttribute(`data-store-location`)) : -1); + secretariat.write(DATA[`target`], ELEMENT.value.trim(), (ELEMENT.hasAttribute(`data-store-location`)) ? parseInt(ELEMENT.getAttribute(`data-store-location`)) : -1); } } break;