From 90eddf8b85e0edb4eb50022d9623cef7f57218b5 Mon Sep 17 00:00:00 2001 From: Peter Rotich <peter@osticket.com> Date: Mon, 3 Mar 2014 18:38:38 +0000 Subject: [PATCH] Close tip popup on click outside the tip box. Credit: http://stackoverflow.com/a/7385673/2867073 --- scp/js/tips.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scp/js/tips.js b/scp/js/tips.js index 205eb6fc9..6d7a3c051 100644 --- a/scp/js/tips.js +++ b/scp/js/tips.js @@ -190,4 +190,12 @@ jQuery(function() { e.preventDefault(); $(this).parent().parent().remove(); }); + + $(document).live('mouseup', function (e) { + var container = $('.tip_box'); + if (!container.is(e.target) + && container.has(e.target).length === 0) { + container.remove(); + } + }); }); -- GitLab