adding full on blur functionality for the tickets dropdown options
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 4 Apr 2017 14:23:22 +0000 (10:23 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 4 Apr 2017 14:23:22 +0000 (10:23 -0400)
to hide the select box on blur

js/app.js
js/custom/pageSetup.js

index 6217c4f..eac20cc 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -83,9 +83,15 @@ $(document).ready(function () {
         $(this).next().css("display","block");
         $(this).next().focus();
     });
-    $('.pseudo-content').on("blur", function(){
-       console.log("test") ;
-        $(this).css("display", "none");
+    var mouse_is_inside = false;
+    $('.pseudo-content').hover(function(){ 
+        mouse_is_inside=true; 
+    }, function(){ 
+        mouse_is_inside=false; 
+    });
+
+    $("body").mouseup(function(){ 
+        if(! mouse_is_inside) $('.pseudo-content').hide();
     });
 
     function getValue(el, input, cost){
index 0eb6d22..b705634 100644 (file)
@@ -72,8 +72,15 @@ $(document).ready(function () {
         $(this).next().css("display","block");
         $(this).next().focus();
     });
-    $('.pseudo-content').on("blur", function(){
-        $(this).css("display", "none");
+    var mouse_is_inside = false;
+    $('.pseudo-content').hover(function(){ 
+        mouse_is_inside=true; 
+    }, function(){ 
+        mouse_is_inside=false; 
+    });
+
+    $("body").mouseup(function(){ 
+        if(! mouse_is_inside) $('.pseudo-content').hide();
     });
 
     function getValue(el, input, cost){