From ec6163607c83ca5ef37719bd059dfe07bed66bc4 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 28 Oct 2018 10:24:25 +0100 Subject: [PATCH] =?UTF-8?q?Unn=C3=B6tigen=20document-ready=20code=20entfer?= =?UTF-8?q?nen=20(#39)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/watson.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/assets/watson.js b/assets/watson.js index 104095d..0ae651e 100644 --- a/assets/watson.js +++ b/assets/watson.js @@ -9,14 +9,11 @@ jQuery(function($){ | */ - $(document).ready( function() { - - var $watson_id = getUrlParameter('watson_id'); - var $watson_text = getUrlParameter('watson_text'); - if ($watson_id && $watson_text) { - $('#' + $watson_id).val($watson_text).focus(); - } - }); + var $watson_id = getUrlParameter('watson_id'); + var $watson_text = getUrlParameter('watson_text'); + if ($watson_id && $watson_text) { + $('#' + $watson_id).val($watson_text).focus(); + } function getUrlParameter(name) { return decodeURI( @@ -95,10 +92,8 @@ jQuery(function($){ var $watsonTypeahead = $('#watson-agent .typeahead'); var $watsonOverlay = $('#watson-overlay'); - $(document).ready( function() { - $watsonOverlay.click(function(){ - hideWatsonAgent(); - }); + $watsonOverlay.click(function(){ + hideWatsonAgent(); }); // support buttons created dynamically