дубль таск
This commit is contained in:
@@ -24,24 +24,65 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
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);
|
||||
document.getElementById('edit-task-form').addEventListener('submit', updateTask);
|
||||
document.getElementById('copy-task-form').addEventListener('submit', copyTask);
|
||||
// Форма создания задачи
|
||||
const createForm = document.getElementById('create-task-form');
|
||||
if (createForm && !createForm._hasSubmitListener) {
|
||||
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);
|
||||
document.getElementById('edit-files').addEventListener('change', updateEditFileList);
|
||||
const filesInput = document.getElementById('files');
|
||||
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');
|
||||
if (notificationForm) {
|
||||
if (notificationForm && !notificationForm._hasSubmitListener) {
|
||||
notificationForm.addEventListener('submit', saveNotificationSettings);
|
||||
notificationForm._hasSubmitListener = true;
|
||||
}
|
||||
|
||||
// Инициализация загрузки файлов
|
||||
|
||||
Reference in New Issue
Block a user