From: Aleksey Filippov Date: Thu, 12 Feb 2026 18:06:43 +0000 (+0300) Subject: [ERP-39] Создание страницы для добавления курьеров. X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=13470a1cb3c19799c90dcfc5747b4f8d12e15a0e;p=erp24_rep%2Fyii-erp24%2F.git [ERP-39] Создание страницы для добавления курьеров. --- diff --git a/erp24/web/js/shift-reminder.js b/erp24/web/js/shift-reminder.js index d6f708f6..5267b9a9 100644 --- a/erp24/web/js/shift-reminder.js +++ b/erp24/web/js/shift-reminder.js @@ -62,6 +62,16 @@ // Initialize Web Audio API (lazy loading to respect autoplay policies) initAudioContext(); + // Setup event delegation for confirm button (works for both server-rendered and dynamic modals) + $(document).on('click', '#shift-reminder-confirm-btn, #shift-reminder-confirm-btn-dynamic', function() { + const reminderKey = $('#shift-reminder-key').val() || $(this).data('reminder-key'); + if (reminderKey) { + confirmReminder(reminderKey); + } else { + console.error('ShiftReminder: reminder_key not found'); + } + }); + // First check on load — response will schedule the next one via next_check_at checkReminder(); } @@ -224,31 +234,44 @@ state.isModalVisible = true; - // Create modal HTML - // Create modal structure without user data (XSS protection) - const $modal = $('
').attr('id', 'shift-reminder-modal').addClass('shift-reminder-overlay'); - const $content = $('
').addClass('shift-reminder-content'); - const $icon = $('
').addClass('shift-reminder-icon').html(''); - const $title = $('

').addClass('shift-reminder-title').text('Напоминание о смене'); - const $message = $('

').addClass('shift-reminder-message'); - const $button = $('