MDL-76694 core_comment: exit the js init if the element cannot be found
commit776319ac8e87d1c4f79b2527a909617d224b7b68
authorJake Dallimore <jake@moodle.com>
Fri, 29 Sep 2023 08:21:26 +0000 (29 16:21 +0800)
committerJake Dallimore <jake@moodle.com>
Fri, 3 Nov 2023 02:26:49 +0000 (3 10:26 +0800)
tree43a55dbde79354ba25052835f0ba937e25e799ff
parentdd115e572a071d11856cd03ec7222074a0435a28
MDL-76694 core_comment: exit the js init if the element cannot be found

In pages which result in the theme_boost/embedded template being used,
blocks may be rendered and the resulting HTML ignored, leaving any JS
they may have added to run without a corresponding DOM element to act
on. This fixes that case for comments, making sure we exit gracefully
during the init if the element can't be found.
comment/comment.js