The D7460N app should be "self aware" of the data in it.
The boolean logic of open/close/show/hide is not governed directly by buttons. Buttons only post/get data. The boolean logic is governed by whether the target HTML element has data or not.
For example;
Panels, accordions, and menus are prestaged and hidden by default. display: none
When data is :observe'd within a panel, accordion, or menu, a class or data- attribute is added, removed, or changed in <body>.
Pre written CSS rules change the panel, accordion, or menu's display: none; to display: grid;.
Buttons no longer open/close/show/hide things directly. Buttons only post/get data.
A little more effort up front but ultimately will results in half the logic/code to write.
This allows for the "separation of concerns (data and UI)" spec.
The D7460N app should be "self aware" of the data in it.
The boolean logic of open/close/show/hide is not governed directly by buttons. Buttons only post/get data. The boolean logic is governed by whether the target HTML element has data or not.
For example;
Panels, accordions, and menus are prestaged and hidden by default.
display: none
When data is
:observe
'd within a panel, accordion, or menu, a class ordata-
attribute is added, removed, or changed in<body>
.Pre written CSS rules change the panel, accordion, or menu's
display: none;
todisplay: grid;
.Buttons no longer open/close/show/hide things directly. Buttons only post/get data.
A little more effort up front but ultimately will results in half the logic/code to write.
This allows for the "separation of concerns (data and UI)" spec.