From ec00684edd37fde57c6df30247606b2d7c44cd2b Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Mon, 2 Nov 2026 22:22:51 -0500 Subject: [PATCH] Clear all lines asks in redmine_dark_mode's dialog when it's installed On dark pages the confirmation is dark instead of the browser's bright box; without redmine_dark_mode it's the browser's box as before. Co-Authored-By: Claude Opus 5.5 --- app/views/qbo_estimates/_script.html.erb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/views/qbo_estimates/_script.html.erb b/app/views/qbo_estimates/_script.html.erb index 8cd63cf..cc4eca6 100644 --- a/app/views/qbo_estimates/_script.html.erb +++ b/app/views/qbo_estimates/_script.html.erb @@ -415,10 +415,18 @@ $(function () { }); $('#qbo-estimate-clear-lines').on('click', function () { - if (!window.confirm($(this).data('confirmText'))) return; - rows().remove(); - addRow(); addRow(); - changed(); + function clearLines() { + rows().remove(); + addRow(); addRow(); + changed(); + } + // redmine_dark_mode asks in a dark dialog on dark pages; otherwise the browser's own box + var message = $(this).data('confirmText'); + if (window.RedmineDarkMode && window.RedmineDarkMode.confirm) { + window.RedmineDarkMode.confirm(message, clearLines); + } else if (window.confirm(message)) { + clearLines(); + } }); // Drag lines by the handle to reorder them; they're saved in table order