I’ve been trying to tune the performance of my wiki and there are some very “expensive” filters than run on some of my pages. I tried the standard html <details>
functionality and while it looks good, my testing seems to indicate that the content within the details all gets run whether it shows or not. That would sometimes be useful in that expanding and contracting the content repeatedly wouldn’t re-run the filters, but for me I essentially only want the filters to process when I’ve clicked to expand. I looked through what I could find, and it seems most of the things posted here just had extra css on the standard functionality, so I wrote a quick widget to essentially make it look like details, but wrap it in some logic to store a value for hide/show so it won’t process unless asked to.
I tried to keep as close to standard as possible so instead of the standard:
<details><summary>My Caption</summary>
This is my content
</details>
This version is:
<$.details caption="My Caption">
This is my content
</$.details>
I used white arrows instead of black to add a tiny bit of visual differentiation so I can distinguish it. Again, the main purpose is to shift performance bottlenecks. You can also set your own ID so multiple things expand and contract (it’s based on currentTiddler right now as a fallback). It also seems to handle block content like bullet lists automatically (in the standard html I think you have to wrap with divs?)
$__stobot_widgets_details.json (650 Bytes)