v1.4.1 — 修复板块选择器不触发自动保存
- blur/change 事件增加 select 支持 - 板块选择后立即自动保存,不再阻塞日历切换
This commit is contained in:
@@ -547,13 +547,20 @@
|
|||||||
var panel = document.getElementById('panel-daily');
|
var panel = document.getElementById('panel-daily');
|
||||||
if (!panel) return;
|
if (!panel) return;
|
||||||
|
|
||||||
// 输入框 & 文本域:失去焦点时保存
|
// 输入框 & 文本域 & 下拉选择器:失去焦点时保存
|
||||||
panel.addEventListener('blur', function(e) {
|
panel.addEventListener('blur', function(e) {
|
||||||
if (e.target.matches('input[type="text"], textarea, input[type="date"]')) {
|
if (e.target.matches('input[type="text"], textarea, input[type="date"], select')) {
|
||||||
triggerAutoSave();
|
triggerAutoSave();
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
|
// 选择器:change 事件也保存(及时响应)
|
||||||
|
panel.addEventListener('change', function(e) {
|
||||||
|
if (e.target.matches('select.morning-pillar')) {
|
||||||
|
triggerAutoSave();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// 复选框:change 事件
|
// 复选框:change 事件
|
||||||
panel.addEventListener('change', function(e) {
|
panel.addEventListener('change', function(e) {
|
||||||
if (e.target.matches('input[type="checkbox"]')) {
|
if (e.target.matches('input[type="checkbox"]')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user