From 6e08a0ed795f317167e814bbef5ec0f00c837848 Mon Sep 17 00:00:00 2001 From: Daniil Tkachev Date: Thu, 10 Oct 2024 17:33:31 +0200 Subject: [PATCH] UNZER-500 Fix alert in order admin on payout --- views/twig/admin/tpl/oscunzer_order.html.twig | 46 ++++++++----------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/views/twig/admin/tpl/oscunzer_order.html.twig b/views/twig/admin/tpl/oscunzer_order.html.twig index 2b52f58a..fbabc387 100644 --- a/views/twig/admin/tpl/oscunzer_order.html.twig +++ b/views/twig/admin/tpl/oscunzer_order.html.twig @@ -341,43 +341,33 @@ {{ script({ add: collectConfirm, dynamic: __oxid_include_dynamic }) }} -{% capture assign = "payoutConfirm" %} +{% capture assign = "payoutNoticeJS" %} +{% if false %} {% endif %} -{% capture assign = "payoutNoticeJS" %} - document.addEventListener('DOMContentLoaded', function () { - let payoutButtons = document.querySelectorAll('input[id^="submit_s-chg-"]'); - - payoutButtons.forEach(function(button) { - button.addEventListener('click', function(event) { - let formId = button.form.id; - let form = document.getElementById(formId); - - if (form) { - let amountInput = form.querySelector('input[name="amount"]'); - let amount = amountInput ? amountInput.value : 0; - let confirmed = window.confirm('{{ translate({ ident: "OSCUNZER_CANCEL_ALERT" }) }}' + ' ' + amount + ' {{ uzrCurrency }}'); - if (!confirmed) { - event.preventDefault(); - } - } - }); - }); - }); {% endcapture %} {{ script({ add: payoutNoticeJS, dynamic: __oxid_include_dynamic }) }}