I have a TW macro which calls several other macros to perform some tasks! It has some UIs, like inputbox, radio buttons, sliders, …
In some special use cases, without adding complexity to macro, I use a CSS class to hide part of UI
Example
<section class="kk-ui-main">
<$list ....
.
.
<$let ....
Some computations, processing go here ...
.
</section>
I just dynamically set the display of property of kk-ui-main
class to none
!
The other solution is to put the whole section inside a $list
widget and using a filter prevent processing the section!
From performance point of view, which method is better?
- Use a conditional class to set its
display
tonone
and hide the section? - Use a
$list
widget and put the whole section inside it and conditionally decide to process the section or not? ($list
acts like anif
construct)
In case (1) does TW do the whole processing and browser just hide the output? Or TW ignores the content behind a section with display
set to none
?