improve task list handling
This commit is contained in:
@@ -21,4 +21,25 @@
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
var hasChecked = !!document.querySelector('input.task-checkbox:checked');
|
||||
if (hasChecked) {
|
||||
var btn = document.querySelector('[data-action="clean-tasks"]');
|
||||
if (btn) btn.hidden = false;
|
||||
}
|
||||
})();
|
||||
|
||||
function cleanUpTasks() {
|
||||
openModal({
|
||||
title: 'Clean up tasks',
|
||||
body: 'Remove all completed tasks from this page?',
|
||||
confirm: {
|
||||
label: 'CLEAN UP',
|
||||
danger: true,
|
||||
onConfirm: function () {
|
||||
closeModal();
|
||||
postReplace(window.location.pathname + '?cleantasks=1', null, window.location.pathname);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user