summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorWu Cheng-Han2017-03-22 15:42:38 +0800
committerWu Cheng-Han2017-03-22 15:42:38 +0800
commit802ed406e65072fc83aee402a5aa86523c530b4d (patch)
tree41abdc282f360651b4db075f064fd3f7618a5cda /public
parent9ff3649025ec0c811e013fbf9585c93d38a6fbfb (diff)
Fix todo list item class might add in wrong element
Diffstat (limited to '')
-rw-r--r--public/js/extra.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/public/js/extra.js b/public/js/extra.js
index ffd95a27..d237a2f2 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -253,7 +253,11 @@ 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>`)
- li.setAttribute('class', 'task-list-item')
+ 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