diff --git a/calendar.js b/calendar.js index 8abd922..0b83c86 100644 --- a/calendar.js +++ b/calendar.js @@ -78,6 +78,9 @@ rendCal(); }); +const query = window.location.search;//管理者モード実装 +if(query ==="?admin"){ + document.querySelectorAll("#calendar td[data-date]").forEach(td => { td.addEventListener("click", ()=> { const datekey=td.getAttribute("data-date"); @@ -92,15 +95,7 @@ } }); }); - +} } rendCal(); }); - -const query = window.location.search; -if(query ==="?admin"){ - -} -else{ - -}