дубль таск

This commit is contained in:
2026-03-05 11:48:44 +05:00
parent 9db1a4225b
commit 72bd9108ca

View File

@@ -24,24 +24,65 @@ document.addEventListener('DOMContentLoaded', function() {
function setupEventListeners() { function setupEventListeners() {
// Форма входа // Форма входа
document.getElementById('login-form').addEventListener('submit', login); const loginForm = document.getElementById('login-form');
if (loginForm && !loginForm._hasSubmitListener) {
loginForm.addEventListener('submit', login);
loginForm._hasSubmitListener = true;
}
// Формы задач // Форма создания задачи
document.getElementById('create-task-form').addEventListener('submit', createTask); const createForm = document.getElementById('create-task-form');
document.getElementById('edit-task-form').addEventListener('submit', updateTask); if (createForm && !createForm._hasSubmitListener) {
document.getElementById('copy-task-form').addEventListener('submit', copyTask); createForm.addEventListener('submit', createTask);
createForm._hasSubmitListener = true;
}
document.getElementById('edit-assignment-form').addEventListener('submit', updateAssignment); // Форма редактирования задачи
document.getElementById('rework-task-form').addEventListener('submit', sendForRework); const editForm = document.getElementById('edit-task-form');
if (editForm && !editForm._hasSubmitListener) {
editForm.addEventListener('submit', updateTask);
editForm._hasSubmitListener = true;
}
// Форма копирования задачи
const copyForm = document.getElementById('copy-task-form');
if (copyForm && !copyForm._hasSubmitListener) {
copyForm.addEventListener('submit', copyTask);
copyForm._hasSubmitListener = true;
}
// Форма редактирования назначения
const editAssignmentForm = document.getElementById('edit-assignment-form');
if (editAssignmentForm && !editAssignmentForm._hasSubmitListener) {
editAssignmentForm.addEventListener('submit', updateAssignment);
editAssignmentForm._hasSubmitListener = true;
}
// Форма доработки
const reworkForm = document.getElementById('rework-task-form');
if (reworkForm && !reworkForm._hasSubmitListener) {
reworkForm.addEventListener('submit', sendForRework);
reworkForm._hasSubmitListener = true;
}
// Файлы // Файлы
document.getElementById('files').addEventListener('change', updateFileList); const filesInput = document.getElementById('files');
document.getElementById('edit-files').addEventListener('change', updateEditFileList); if (filesInput && !filesInput._hasChangeListener) {
filesInput.addEventListener('change', updateFileList);
filesInput._hasChangeListener = true;
}
const editFilesInput = document.getElementById('edit-files');
if (editFilesInput && !editFilesInput._hasChangeListener) {
editFilesInput.addEventListener('change', updateEditFileList);
editFilesInput._hasChangeListener = true;
}
// Настройки уведомлений // Настройки уведомлений
const notificationForm = document.getElementById('notification-settings-form'); const notificationForm = document.getElementById('notification-settings-form');
if (notificationForm) { if (notificationForm && !notificationForm._hasSubmitListener) {
notificationForm.addEventListener('submit', saveNotificationSettings); notificationForm.addEventListener('submit', saveNotificationSettings);
notificationForm._hasSubmitListener = true;
} }
// Инициализация загрузки файлов // Инициализация загрузки файлов