From a602865feea26835f86b54a576b8c8290542b376 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 12 May 2024 14:56:47 +0200 Subject: [PATCH] fix force version re-check button Signed-off-by: Michael Kaufmann --- templates/Froxlor/assets/js/jquery/updatecheck.js | 13 ++++++++----- templates/Froxlor/misc/version_popover.html.twig | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/templates/Froxlor/assets/js/jquery/updatecheck.js b/templates/Froxlor/assets/js/jquery/updatecheck.js index 1a8d686a34..45cfdbe28b 100644 --- a/templates/Froxlor/assets/js/jquery/updatecheck.js +++ b/templates/Froxlor/assets/js/jquery/updatecheck.js @@ -7,10 +7,6 @@ export default function () { runCheck(); } - $('#forceUpdateCheck').on('click', function () { - runCheck(1); - }); - function runCheck(force = 0) { $.ajax({ @@ -18,7 +14,14 @@ export default function () { type: "GET", success: function (data) { $("#updatecheck").html(data); - new bootstrap.Popover(document.getElementById('ucheck')); + const po = new bootstrap.Popover(document.getElementById('ucheck')); + const myPopoverTrigger = document.getElementById('ucheck') + myPopoverTrigger.addEventListener('shown.bs.popover', () => { + $('#forceUpdateCheck').on('click', function () { + runCheck(1); + po.hide(); + }); + }) }, error: function (request, status, error) { console.log(request, status, error) diff --git a/templates/Froxlor/misc/version_popover.html.twig b/templates/Froxlor/misc/version_popover.html.twig index 5f1c706b51..ee1642cebc 100644 --- a/templates/Froxlor/misc/version_popover.html.twig +++ b/templates/Froxlor/misc/version_popover.html.twig @@ -27,6 +27,6 @@ {% endif %} {% endif %}
- +
{% endmacro %}