Fix todo list item class might add in wrong element
This commit is contained in:
parent
9ff3649025
commit
802ed406e6
1 changed files with 5 additions and 1 deletions
|
@ -253,8 +253,12 @@ export function finishView (view) {
|
|||
if (/^\s*\[[x ]\]\s*/.test(html)) {
|
||||
li.innerHTML = html.replace(/^\s*\[ \]\s*/, `<input type="checkbox" class="task-list-item-checkbox "${disabled}><label></label>`)
|
||||
.replace(/^\s*\[x\]\s*/, `<input type="checkbox" class="task-list-item-checkbox" checked ${disabled}><label></label>`)
|
||||
if (li.tagName.toLowerCase() !== 'li') {
|
||||
li.parentElement.setAttribute('class', 'task-list-item')
|
||||
} else {
|
||||
li.setAttribute('class', 'task-list-item')
|
||||
}
|
||||
}
|
||||
if (typeof editor !== 'undefined' && window.havePermission()) { $(li).find('input').change(toggleTodoEvent) }
|
||||
// color tag in list will convert it to tag icon with color
|
||||
const tagColor = $(li).closest('ul').find('.color')
|
||||
|
|
Loading…
Reference in a new issue