fix: 保存后展示日记列表并将统计移动到右侧

This commit is contained in:
guoqingshan
2026-08-02 10:35:52 +08:00
parent ffdeb79c0b
commit 870f8a5da3
3 changed files with 24 additions and 11 deletions
+10 -1
View File
@@ -299,11 +299,13 @@ function saveCurrentEntry() {
renderTranslate({ english: translation.english, chinese: translation.chinese });
var found = entries.find(function(e) { return e.id === state.currentId; });
if (found) setEditor(found);
showDiaryListView();
document.getElementById('btn-save').textContent = '\uD83D\uDCBE 已保存 \u2713';
setTimeout(function() { document.getElementById('btn-save').textContent = '\uD83D\uDCBE 保存'; }, 1500);
});
}).catch(function() {
}).catch(function(err) {
document.getElementById('btn-save').textContent = '\uD83D\uDCBE 保存';
alert((err && err.message) || '保存失败,请检查网络或登录状态');
});
}
@@ -313,6 +315,13 @@ function newEntry() {
document.getElementById('entry-text').focus();
}
function showDiaryListView() {
document.body.dataset.view = 'list';
document.querySelectorAll('#mobile-nav button').forEach(function(btn) {
btn.classList.toggle('active', btn.dataset.view === 'list');
});
}
// ----- Modal -----
var pendingDeleteId = null;