Updated tasklist style and functionality for cross-browser use

- Updated styles to better align checkboxes within page content.
- Updated functionality to use a cross-compatible property on checkbox
  click within the editor.
This commit is contained in:
Dan Brown 2022-03-23 11:51:19 +00:00
parent c5aad29c72
commit 883e18f7c4
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 7 additions and 1 deletions

View File

@ -84,9 +84,10 @@ function register(editor, url) {
// Handle checkbox click in editor
editor.on('click', function(event) {
const clickedEl = event.originalTarget;
const clickedEl = event.target;
if (clickedEl.nodeName === 'LI' && clickedEl.classList.contains('task-list-item')) {
handleTaskListItemClick(event, clickedEl, editor);
event.preventDefault();
}
});
}

View File

@ -164,6 +164,11 @@ body.tox-fullscreen, body.markdown-fullscreen {
clear: both;
}
li > input[type="checkbox"] {
vertical-align: top;
margin-top: 0.3em;
}
p:empty {
min-height: 1.6em;
}