From 4214bc93d72e42a088f1782968f76021e19cb8c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Oliveros?= Date: Thu, 18 May 2017 17:29:13 -0500 Subject: [PATCH] fix extranous btn class issue --- static/config-check.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/static/config-check.js b/static/config-check.js index d130164..01a81f5 100644 --- a/static/config-check.js +++ b/static/config-check.js @@ -1,16 +1,18 @@ $(function() { $.get('/config', function(response) { - configureField(response, 'TWILIO_ACCOUNT_SID','twilioAccountSID',false); - configureField(response, 'TWILIO_API_KEY','twilioAPIKey',false); - configureField(response, 'TWILIO_API_SECRET','twilioAPISecret',true); - configureField(response, 'TWILIO_NOTIFICATION_SERVICE_SID','twilioNotificationServiceSID',false); - configureField(response, 'TWILIO_CHAT_SERVICE_SID','twilioChatServiceSID',false); - configureField(response, 'TWILIO_SYNC_SERVICE_SID','twilioSyncServiceSID',false); + configureField(response, 'TWILIO_ACCOUNT_SID', 'twilioAccountSID', false); + configureField(response, 'TWILIO_API_KEY', 'twilioAPIKey', false); + configureField(response, 'TWILIO_API_SECRET', 'twilioAPISecret', true); + configureField(response, 'TWILIO_NOTIFICATION_SERVICE_SID', 'twilioNotificationServiceSID', false); + configureField(response, 'TWILIO_CHAT_SERVICE_SID', 'twilioChatServiceSID', false); + configureField(response, 'TWILIO_SYNC_SERVICE_SID', 'twilioSyncServiceSID', false); //configure individual product buttons if (response.TWILIO_ACCOUNT_SID && response.TWILIO_ACCOUNT_SID != '' && response.TWILIO_API_KEY && response.TWILIO_API_KEY != '' && response.TWILIO_API_SECRET) { + $('#videoDemoButton').addClass('btn-success'); + if (response.TWILIO_CHAT_SERVICE_SID && response.TWILIO_CHAT_SERVICE_SID != '') { $('#chatDemoButton').addClass('btn-success'); } else { @@ -35,12 +37,9 @@ $(function() { $('#syncDemoButton').addClass('btn-danger'); $('#notifyDemoButton').addClass('btn-danger'); } - - - }); - var configureField = function(response, keyName,elementId,masked) { + var configureField = function(response, keyName, elementId, masked) { if (masked) { if (response[keyName]) { $('#' + elementId).html('Configured properly'); @@ -58,6 +57,5 @@ $(function() { $('#' + elementId).addClass('unset'); } } - }; -}); +}); \ No newline at end of file