]> cat aescling's git repositories - mastodon.git/commit
Fix inline spoiler text in modals
authorkibigo! <go@kibi.family>
Sun, 13 Nov 2022 08:02:35 +0000 (00:02 -0800)
committerkibigo! <go@kibi.family>
Sun, 13 Nov 2022 08:30:33 +0000 (00:30 -0800)
commit7d64057ac99096e9dcad783d0298b2775753e35b
tree3baa3b72415f87072d9ade334205decfffa8aaa6
parent07c5037f3d6c4db17cdd510c6fbadb95e881816e
Fix inline spoiler text in modals

This requires “connecting” `<StatusContent>`, which isn’t “great” but
is basically necessary at this point. On the plus side, this makes the
code a bit DRYer.

Due to the way modals work, updating status contents doesn’t actually
trigger a React rerender. This is actually fine, because we (have to)
update status contents live anyway, but it does require ensuring that
appropriate event listeners get attached so that the spoiler can be
toggled again.

To keep listeners from being added multiple times (which wouldn’t have
a negative effect but could be a performance leak), elements with
listeners are now tracked in a `WeakSet`.
app/javascript/flavours/glitch/components/status.js
app/javascript/flavours/glitch/components/status_content.js
app/javascript/flavours/glitch/containers/status_container.js
app/javascript/flavours/glitch/containers/status_content_container.js [new file with mode: 0644]
app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js
app/javascript/flavours/glitch/features/report/components/status_check_box.js
app/javascript/flavours/glitch/features/status/components/detailed_status.js
app/javascript/flavours/glitch/features/status/index.js
app/javascript/flavours/glitch/features/ui/components/actions_modal.js
app/javascript/flavours/glitch/features/ui/components/boost_modal.js
app/javascript/flavours/glitch/features/ui/components/favourite_modal.js