Diff

mod_http_muc_log/static/timestamps.js @ 5106:630887a50a7d

mod_http_muc_log: Fix error in js when displaying presence is disabled When the form is hidden, attempting to index forms[0] throws an error, however this is harmless since the script is finished by that point.
author Kim Alvefur <zash@zash.se>
date Sun, 04 Dec 2022 22:23:56 +0100
parent 5104:d4b0a995e5e3
child 5109:650d04984e0b
line wrap: on
line diff
--- a/mod_http_muc_log/static/timestamps.js	Sun Dec 04 22:21:05 2022 +0100
+++ b/mod_http_muc_log/static/timestamps.js	Sun Dec 04 22:23:56 2022 +0100
@@ -12,8 +12,10 @@
 tag.setAttribute("title", date.toString());
 }
 }
+if(document.forms.length>0){
 document.forms[0].elements.p.addEventListener("change", function() {
 document.forms[0].submit();
+}
 });
 })();