Only register onchange once the submit button has been pressed

This commit is contained in:
tleb 2019-10-15 10:23:15 +02:00
parent 13312e9879
commit 0011f4c7b0

View File

@ -188,14 +188,12 @@
} }
submit.addEventListener('click', () => { submit.addEventListener('click', () => {
if (!submitPressed) {
easymde.codemirror.on('change', checkMarkdownInput)
}
submitPressed = true submitPressed = true
checkMarkdownInput() checkMarkdownInput()
}) })
easymde.codemirror.on('change', () => {
if (submitPressed) {
checkMarkdownInput()
}
})
}) })
</script> </script>
</div> </div>