testing ajax loader and grey out of header search
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 4 May 2017 16:50:38 +0000 (12:50 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 4 May 2017 16:50:38 +0000 (12:50 -0400)
testing the before and complete functions of the ajax search in the header to prevent the user
from seeing the options load in front of them

js/app.js
js/custom/headerSearch.js

index 3fa69a9..fc37436 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -218,7 +218,13 @@ $(document).ready(function () {
                 destination: destination,
                 others: {'activity' : $('#activity-search option:selected').val(), 'park' : $('#park-search option:selected').val()}
             },
-
+            beforeSend: function(){
+                activities.prop('disabled','disabled');
+                parks.prop('disabled','disabled');
+            },
+            complete: function(){
+                activities.prop('disabled',false);
+            },
             success:function(data){
                 console.log(data.categories);
                var destination_data = data;
index ccef579..a500fd8 100644 (file)
@@ -209,7 +209,13 @@ $(document).ready(function () {
                 destination: destination,
                 others: {'activity' : $('#activity-search option:selected').val(), 'park' : $('#park-search option:selected').val()}
             },
-
+            beforeSend: function(){
+                activities.prop('disabled','disabled');
+                parks.prop('disabled','disabled');
+            },
+            complete: function(){
+                activities.prop('disabled',false);
+            },
             success:function(data){
                 console.log(data.categories);
                var destination_data = data;