Fix TODO/DONE line-through
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2021-10-29 22:32:25 +02:00
parent b63eb7948f
commit a4bff99cee

View File

@ -388,9 +388,9 @@ function Editor(holder, input) {
} }
try { try {
const todoItem = $(converted).find(':checkbox') const todoItem = $.parseHTML(converted)
if (todoItem.length) { if (todoItem.length && $(todoItem[0]).is(':checkbox')) {
const todo = !todoItem.is(':checked') const todo = !$(todoItem[0]).is(':checked')
element.toggleClass('todo--done', todo === false) element.toggleClass('todo--done', todo === false)
element.toggleClass('todo--todo', todo === true) element.toggleClass('todo--todo', todo === true)
} else { } else {