mirror of
https://github.com/privacyguides/privacyguides.org.git
synced 2024-12-20 21:34:34 -05:00
a52770e1c0
Signed-off-by: Daniel Gray <dng@disroot.org>
24 lines
595 B
JavaScript
24 lines
595 B
JavaScript
var feedback = document.forms.feedback
|
|
/* Show feedback */
|
|
feedback.hidden = false
|
|
feedback.addEventListener("submit", function(ev) {
|
|
ev.preventDefault()
|
|
|
|
/* Retrieve page and feedback value */
|
|
var page = document.location.pathname
|
|
var data = ev.submitter.getAttribute("data-md-value")
|
|
|
|
/* Send feedback value */
|
|
console.log(page, data)
|
|
plausible(data)
|
|
|
|
/* Disable form and show note, if given */
|
|
feedback.firstElementChild.disabled = true
|
|
var note = feedback.querySelector(
|
|
".md-feedback__note [data-md-value='" + data + "']"
|
|
)
|
|
|
|
if (note)
|
|
note.hidden = false
|
|
})
|