kalender und fixes
This commit is contained in:
1 parent
940d9bbde4
commit
416ca9e854
14 files changed
+376
-71
No files matched your search
@@ -151,6 +151,9 @@ export function openModal(card = null) {
|
||||
}
|
||||
|
||||
inpTitle.addEventListener('input', updatePreview);
|
||||
inpTitle.addEventListener('keydown', e => {
|
||||
if (e.key === 'Tab' && !e.shiftKey) { e.preventDefault(); body.focus(); }
|
||||
});
|
||||
|
||||
// ── Line numbers ──
|
||||
|
||||
@@ -315,9 +318,8 @@ function updatePreview() {
|
||||
addCodeCopyButtons(previewContent);
|
||||
formatTodoItems(previewContent);
|
||||
// Interactive checkboxes in editor preview — toggle in textarea
|
||||
previewContent.querySelectorAll('input[type="checkbox"]').forEach((cb, idx) => {
|
||||
cb.disabled = false;
|
||||
cb.addEventListener('change', () => {
|
||||
previewContent.querySelectorAll('.todo-item').forEach((item, idx) => {
|
||||
item.addEventListener('click', () => {
|
||||
let n = 0;
|
||||
body.value = body.value.replace(/- \[([ x])\]/g, (m, s) => n++ === idx ? `- [${s === 'x' ? ' ' : 'x'}]` : m);
|
||||
updatePreview();
|
||||
@@ -754,10 +756,17 @@ document.addEventListener('click', e => {
|
||||
if (tagAcVisible && !tagAc.contains(e.target) && e.target !== body) hideTagAc();
|
||||
if (snippetAcVisible && !snippetAc.contains(e.target) && e.target !== body) hideSnippetAc();
|
||||
});
|
||||
// Capture phase: intercept ESC before dialog overlay can close the modal
|
||||
document.addEventListener('keydown', e => {
|
||||
if (tagAcVisible && e.key === 'Escape') hideTagAc();
|
||||
if (snippetAcVisible && e.key === 'Escape') hideSnippetAc();
|
||||
});
|
||||
if (e.key === 'Escape' && (tagAcVisible || snippetAcVisible || linkAcVisible)) {
|
||||
e.stopImmediatePropagation();
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
if (linkAcVisible) hideLinkAc();
|
||||
if (tagAcVisible) hideTagAc();
|
||||
if (snippetAcVisible) hideSnippetAc();
|
||||
}
|
||||
}, true);
|
||||
|
||||
function completeTagAc(idx) {
|
||||
const tag = tagAcItems[idx];
|
||||
|
||||
Reference in new issue
Block a user