From f674bb4c660dbe712758f2e6ba56f115c364ac6c Mon Sep 17 00:00:00 2001 From: mac Date: Tue, 28 Jul 2026 16:19:59 +0800 Subject: [PATCH] =?UTF-8?q?v2.1.26=20=E2=80=94=20=E6=9C=AC=E5=91=A8?= =?UTF-8?q?=E9=87=8D=E7=82=B9=E6=AF=8F=E6=9D=A1=E4=BB=BB=E5=8A=A1=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/app.js | 31 ++++++++++++++++++++++++++----- static/style.css | 9 +++++++++ 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/static/app.js b/static/app.js index b1a2bd1..5914ea2 100644 --- a/static/app.js +++ b/static/app.js @@ -241,10 +241,13 @@ function buildData() { var morningItems = []; - var mEls = document.querySelectorAll('#morning-list .item-row input'); - for (var i=0; i' + (idx+1) + '.' + '' + - ''; + '' + + '' + + ''; div.addEventListener('dragstart', dragStart); div.addEventListener('dragover', dragOver); div.addEventListener('drop', function(e){ dragDrop.call(this, e, 'morning-list'); }); @@ -360,6 +367,20 @@ renumberMorning(); } + window.toggleItemNote = function(btn) { + var row = btn.closest('.item-row'); + var note = row.querySelector('.item-note'); + var showing = note.style.display === 'block'; + note.style.display = showing ? 'none' : 'block'; + if (!showing) { + btn.classList.add('has-note'); + note.focus(); + } else if (!note.value.trim()) { + btn.classList.remove('has-note'); + } + triggerAutoSave(); + }; + function renumberMorning() { var rows = document.querySelectorAll('#morning-list .item-row'); for (var i=0; i