From 0d53d735926341d0866bd3bfee1237c8ca254b7a 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 7a299ad86..9fdd22617 100644
--- a/scp/js/tips.js
+++ b/scp/js/tips.js
@@ -213,4 +213,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