diff --git a/backend/static/js/components/calendarWidgetIntegration.js b/backend/static/js/components/calendarWidgetIntegration.js index 3ef1e85a..20ae7202 100644 --- a/backend/static/js/components/calendarWidgetIntegration.js +++ b/backend/static/js/components/calendarWidgetIntegration.js @@ -180,13 +180,22 @@ export function integrateCalendarManager(calendarWidgetInstance, options = {}) { }); // Привязываем кнопку создания календаря к модальному окну - const createCalendarBtn = document.querySelector('[data-bs-target="#calendarManageModal"]'); + const createCalendarBtn = document.querySelector('[data-action="create-calendar"]'); if (createCalendarBtn && manageModalInstance) { createCalendarBtn.addEventListener('click', () => { manageModalInstance.openForCreate(); }); } + // Обрабатываем событие редактирования календаря из списка + if (manageModalInstance) { + document.addEventListener('calendar:edit', (e) => { + const calendar = e.detail; + console.log('[CalendarIntegration] Edit calendar requested:', calendar); + manageModalInstance.openForEdit(calendar.id); + }); + } + // Создаём объект интеграции const integration = { /** diff --git a/backend/templates/includes/components/calendar_desktop.html b/backend/templates/includes/components/calendar_desktop.html index 5d7966d5..bab1ccbb 100644 --- a/backend/templates/includes/components/calendar_desktop.html +++ b/backend/templates/includes/components/calendar_desktop.html @@ -25,8 +25,7 @@