Index: openacs-4/packages/xowiki/tcl/chat-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/chat-procs.tcl,v diff -u -N -r1.54.2.35 -r1.54.2.36 --- openacs-4/packages/xowiki/tcl/chat-procs.tcl 30 Jan 2024 09:35:42 -0000 1.54.2.35 +++ openacs-4/packages/xowiki/tcl/chat-procs.tcl 20 Mar 2024 10:24:44 -0000 1.54.2.36 @@ -581,6 +581,15 @@
+ }] set conf [dict create] @@ -625,7 +634,15 @@ chatSubscribe('$base_url'); }] - template::add_body_handler -event load -script $js + # + # This handler will wait for the chat to be appended to the DOM to + # trigger the relevant javascript. + # + ::template::head::add_javascript -script [subst -nocommands { + window.addEventListener('xowikichatloaded', () => { + $js + }); + }] template::add_refresh_on_history_handler