Instead of directly attaching the add-code-comment on click handler to the a.add-code-comment elements - make this an event handler on the document instead. Fix #17736 Signed-off-by: Andrew Thornton <art27@cantab.net>