Style the new checkbox
This commit is contained in:
parent
180872e308
commit
63a2f18394
|
@ -99,4 +99,22 @@
|
|||
#isso-root a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#isso-root a {
|
||||
color: var(--whitegrey);
|
||||
}
|
||||
|
||||
.isso-feedlink:hover,
|
||||
.isso-comment > div.text-wrapper > .isso-comment-footer a:hover,
|
||||
#isso-root a:hover {
|
||||
color: #fff;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.comment-checkbox__label {
|
||||
width: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: 20px 1fr;
|
||||
grid-column-gap: 10px;
|
||||
}
|
||||
|
|
4
post.hbs
4
post.hbs
|
@ -141,6 +141,7 @@ into the {body} of the default.hbs template --}}
|
|||
original_submit.style.setProperty("display", "none")
|
||||
const faux_submit = document.createElement("input")
|
||||
faux_submit.value = "Wyślij"
|
||||
faux_submit.type = "submit"
|
||||
const comment_checkbox_id = "comment-checkbox"
|
||||
const checkbox = document.createElement("input")
|
||||
checkbox.type = "checkbox"
|
||||
|
@ -149,10 +150,11 @@ into the {body} of the default.hbs template --}}
|
|||
const label = document.createElement("label")
|
||||
label.for = comment_checkbox_id;
|
||||
label.appendChild(checkbox)
|
||||
label.id = comment_checkbox_id + "__label"
|
||||
const label_text = document.createElement("span")
|
||||
label_text.innerHTML = `akceptuję postanowienia <a href="#">regulaminu komentarzy</a>`
|
||||
label.appendChild(label_text)
|
||||
document.querySelector("#isso-thread .auth-section").appendChild(label)
|
||||
document.querySelector("#isso-thread .auth-section").insertBefore(label, document.querySelector(".auth-section .post-action"))
|
||||
faux_submit.addEventListener("click", ()=>{
|
||||
if(!checkbox.checked){
|
||||
checkbox.reportValidity()
|
||||
|
|
Loading…
Reference in New Issue
Block a user