todo fixes
This commit is contained in:
1 parent
fe93a0f80e
commit
940d9bbde4
8 files changed
+135
-47
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
import { $, esc, api, fuzzyMatch } from './util.js';
|
||||
import { state, parseTags, tagChipHtml, getChildren, getGroupCards, getRecent, markRecent } from './state.js';
|
||||
import { renderMd, stripMd, firstImage, addCodeCopyButtons } from './markdown.js';
|
||||
import { renderMd, stripMd, firstImage, addCodeCopyButtons, formatTodoItems } from './markdown.js';
|
||||
import { pushCardDelete, pushCardEdit, snapshotCard } from './undo.js';
|
||||
import { showDialog } from './dialog.js';
|
||||
|
||||
@@ -449,11 +449,16 @@ function showContent(card) {
|
||||
titleEl.textContent = card.title;
|
||||
bodyEl.innerHTML = renderMd(card.body);
|
||||
addCodeCopyButtons(bodyEl);
|
||||
formatTodoItems(bodyEl);
|
||||
applyReadingResizeHandles(bodyEl);
|
||||
bindDetailImageFullscreen(bodyEl);
|
||||
|
||||
// Interactive checkboxes
|
||||
bodyEl.querySelectorAll('input[type="checkbox"]').forEach((cb, idx) => {
|
||||
bindCheckboxes(bodyEl, card);
|
||||
}
|
||||
|
||||
export function bindCheckboxes(container, card) {
|
||||
container.querySelectorAll('input[type="checkbox"]').forEach((cb, idx) => {
|
||||
cb.disabled = false;
|
||||
cb.addEventListener('change', async () => {
|
||||
let n = 0;
|
||||
@@ -886,7 +891,9 @@ function loadSplitCard(id) {
|
||||
splitContent.querySelectorAll('.card-link[data-card-id]').forEach(link => {
|
||||
link.addEventListener('click', () => loadSplitCard(link.dataset.cardId));
|
||||
});
|
||||
bindCheckboxes(splitContent, card);
|
||||
addCodeCopyButtons(splitContent);
|
||||
formatTodoItems(splitContent);
|
||||
}
|
||||
|
||||
function promoteSplitCard(id) {
|
||||
|
||||
Reference in new issue
Block a user