From 87a05aca130e12ba10e9dc511136fa2e22484c62 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 4 Apr 2017 10:23:22 -0400 Subject: [PATCH] adding full on blur functionality for the tickets dropdown options to hide the select box on blur --- js/app.js | 12 +++++++++--- js/custom/pageSetup.js | 11 +++++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/js/app.js b/js/app.js index 6217c4f..eac20cc 100644 --- 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){ diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 0eb6d22..b705634 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -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){ -- 2.17.1