From: Anthony Talarico Date: Thu, 4 May 2017 16:50:38 +0000 (-0400) Subject: testing ajax loader and grey out of header search X-Git-Tag: v1.0.0^2~94 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=640ccb18ffd19ec16e4a5707112f5c07c90cd239;p=WP-Themes%2Fmichigantrailmaps.git testing ajax loader and grey out of header search 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 --- diff --git a/js/app.js b/js/app.js index 3fa69a9..fc37436 100644 --- 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; diff --git a/js/custom/headerSearch.js b/js/custom/headerSearch.js index ccef579..a500fd8 100644 --- a/js/custom/headerSearch.js +++ b/js/custom/headerSearch.js @@ -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;