From: stephen@cubedesigners.com Date: Tue, 19 Jul 2016 16:17:33 +0000 (+0000) Subject: Hide validation messages on click/touch - better code thanks to Vincent :) #482 ... X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=3612c8b80df38861ef6eb996099818c98f6999ae;p=fluidbook-v3.git Hide validation messages on click/touch - better code thanks to Vincent :) #482 @0:05 --- diff --git a/js/315-quote.js b/js/315-quote.js index 834cf67..621d4fa 100644 --- a/js/315-quote.js +++ b/js/315-quote.js @@ -7,10 +7,6 @@ function load_quoteform() { $(window).on('cubeitopenpopup', function() { initFancySelect(); }); - - $(document).on('click touchend', function() { - $('.validation-messages').hide(); - }); } function initFancySelect() { @@ -32,6 +28,11 @@ function displayErrors(formID) { }); }); + // Hide on any click/touch after messages are displayed + $(document).one('click touchend', function() { + $('.validation-messages').hide(); + }); + // Re-initialise the fancySelect initFancySelect(); } \ No newline at end of file