From d5fb11f525b4424c73dbd0a79f1d67fdc8a34ac0 Mon Sep 17 00:00:00 2001
From: Heinrich Fenkart <hnrch02@gmail.com>
Date: Fri, 25 Apr 2014 16:05:41 +0200
Subject: [PATCH] Only hide modal on transitionend if the event originates from
 the modal; fixes #13223

---
 js/modal.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/js/modal.js b/js/modal.js
index cbca61eed7..8a1bfe0c23 100644
--- a/js/modal.js
+++ b/js/modal.js
@@ -116,7 +116,10 @@
 
     $.support.transition && this.$element.hasClass('fade') ?
       this.$element
-        .one($.support.transition.end, $.proxy(this.hideModal, this))
+        .one($.support.transition.end, $.proxy(function (e) {
+          if (!$(e.target).is(this.$element)) return
+          this.hideModal()
+        }, this))
         .emulateTransitionEnd(300) :
       this.hideModal()
   }
-- 
GitLab