From 640ccb18ffd19ec16e4a5707112f5c07c90cd239 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Thu, 4 May 2017 12:50:38 -0400 Subject: [PATCH] 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 --- js/app.js | 8 +++++++- js/custom/headerSearch.js | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) 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; -- 2.17.1