From c2810a1dcb1a46a65413a83ac244dbb91684f36c Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 17 Oct 2019 19:04:59 +0200 Subject: [PATCH] Fix an issue where click events where pilling up if clicking outside the modal window --- src/js/yunohost/helpers.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/js/yunohost/helpers.js b/src/js/yunohost/helpers.js index 30fae9e2..aabf1cae 100644 --- a/src/js/yunohost/helpers.js +++ b/src/js/yunohost/helpers.js @@ -323,8 +323,13 @@ // Modal content $('.content', box).html(content); + // Clear any remaining click event that could still be there (e.g. + // clicking outside the modal window doesn't equal to clicking + // cancel... + $('#modal footer button').unbind( "click" ); + // Handle buttons - $('footer button', box) + $('#modal footer button', box) .click(function(e){ e.preventDefault();