Skip to content

Commit

Permalink
Merge pull request #936 from 1DC/patch-1
Browse files Browse the repository at this point in the history
Fixed some inconsistencies in the core.js script.
  • Loading branch information
fofr authored Apr 11, 2017
2 parents 599d3d4 + 5a00dea commit a0e4fd7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/assets/javascripts/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@ $(document).ready(function() {
$('.print-link a').attr('target', '_blank');

var $searchFocus = $('.js-search-focus');
$searchFocus.each(function(i, el){
if($(el).val() !== ''){
$searchFocus.each(function(i, el) {
if($(el).val() !== '') {
$(el).addClass('focus');
}
});
$searchFocus.on('focus', function(e){

$searchFocus.on('focus', function(e) {
$(e.target).addClass('focus');
});
$searchFocus.on('blur', function(e){
if($(e.target).val() === ''){

$searchFocus.on('blur', function(e) {
if($(e.target).val() === '') {
$(e.target).removeClass('focus');
}
});

if (window.GOVUK) {
if (GOVUK.userSurveys){
if (GOVUK.userSurveys) {
GOVUK.userSurveys.init();
}

Expand Down

0 comments on commit a0e4fd7

Please sign in to comment.