comparison 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
parents d4b0a995e5e3
children 650d04984e0b
comparison
equal deleted inserted replaced
5105:2402ddabe7f7 5106:630887a50a7d
10 date = new Date(date); 10 date = new Date(date);
11 tag.textContent = date.toLocaleTimeString(navigator.language); 11 tag.textContent = date.toLocaleTimeString(navigator.language);
12 tag.setAttribute("title", date.toString()); 12 tag.setAttribute("title", date.toString());
13 } 13 }
14 } 14 }
15 if(document.forms.length>0){
15 document.forms[0].elements.p.addEventListener("change", function() { 16 document.forms[0].elements.p.addEventListener("change", function() {
16 document.forms[0].submit(); 17 document.forms[0].submit();
18 }
17 }); 19 });
18 })(); 20 })();
19 21