]> _ Git - fluidbook-v3.git/commitdiff
Hide validation messages on click/touch - better code thanks to Vincent :) #482 ...
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 19 Jul 2016 16:17:33 +0000 (16:17 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 19 Jul 2016 16:17:33 +0000 (16:17 +0000)
js/315-quote.js

index 834cf67a09c2ca2e01648c3bde1f92811822fdc7..621d4fac7919507594bc81b02b487b3a459655d4 100644 (file)
@@ -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