From 2f8dbb4a4bdc4bbb09ce14fd132a3b443c33da2f Mon Sep 17 00:00:00 2001 From: bauunion Date: Sun, 7 May 2023 12:23:54 +0200 Subject: [PATCH] Hide modal only when click is outside modal --- js/quickref.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/quickref.js b/js/quickref.js index 6c3a2aed..58c083b9 100644 --- a/js/quickref.js +++ b/js/quickref.js @@ -44,9 +44,11 @@ function show_modal(data, color, type) { $("#modal-bullets").html(bullets_html); } -function hide_modal() { - $("body").removeClass("modal-open"); - $("#modal").removeClass("modal-visible"); +function hide_modal(e) { + if ($.containsnt($("#modal-container").parent()[0], e.target)) { + $("body").removeClass("modal-open"); + $("#modal").removeClass("modal-visible"); + } } function fill_section(data, parentname, type) {