From e60b0e63f0f3afa3ebbdfb53eae17ce53d101446 Mon Sep 17 00:00:00 2001 From: sandeepsajan0 <sandeepsajan0@gmail.com> Date: Tue, 28 Jun 2022 18:44:06 +0530 Subject: [PATCH] Resolve fe lint issues --- .../src/javascript/apply/application-form.js | 32 +++++++++---------- .../src/sass/apply/components/_form.scss | 6 ++-- .../src/sass/public/components/_form.scss | 6 ++-- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/hypha/static_src/src/javascript/apply/application-form.js b/hypha/static_src/src/javascript/apply/application-form.js index f4243541c..477b1c33d 100644 --- a/hypha/static_src/src/javascript/apply/application-form.js +++ b/hypha/static_src/src/javascript/apply/application-form.js @@ -7,27 +7,27 @@ var $application_form_button = $application_form.find('button[type="submit"]'); // set aria-required attribute true for required fields - $application_form.find('input[required]').each(function(index, input_field) { - input_field.setAttribute('aria-required', true) - }) + $application_form.find('input[required]').each(function (index, input_field) { + input_field.setAttribute('aria-required', true); + }); // add label_id as aria-describedby to help texts - $application_form.find('.form__group').each(function(index, form_group){ - var label_id = form_group.querySelector('label').getAttribute('for') - if (form_group.querySelector('.form__help')){ - form_group.querySelector('.form__help').setAttribute('aria-describedby', label_id) + $application_form.find('.form__group').each(function (index, form_group) { + var label_id = form_group.querySelector('label').getAttribute('for'); + if (form_group.querySelector('.form__help')) { + form_group.querySelector('.form__help').setAttribute('aria-describedby', label_id); } - }) + }); // set aria-invalid for field with errors - var $error_fields = $application_form.find('.form__error') - if ($error_fields.length){ - //set focus to the first error field - $error_fields[0].querySelector('input').focus() - - $error_fields.each(function(index, error_field){ - error_field.querySelector('input').setAttribute('aria-invalid', true) - }) + var $error_fields = $application_form.find('.form__error'); + if ($error_fields.length) { + // set focus to the first error field + $error_fields[0].querySelector('input').focus(); + + $error_fields.each(function (index, error_field) { + error_field.querySelector('input').setAttribute('aria-invalid', true); + }); } // Remove the "no javascript" messages diff --git a/hypha/static_src/src/sass/apply/components/_form.scss b/hypha/static_src/src/sass/apply/components/_form.scss index 891f67d96..a0c755425 100644 --- a/hypha/static_src/src/sass/apply/components/_form.scss +++ b/hypha/static_src/src/sass/apply/components/_form.scss @@ -283,10 +283,10 @@ } &__help-link { - a{ + a { &:hover { - cursor: pointer; - color: $color--darkest-blue; + cursor: pointer; + color: $color--darkest-blue; } } } diff --git a/hypha/static_src/src/sass/public/components/_form.scss b/hypha/static_src/src/sass/public/components/_form.scss index 0ca2e815a..27046ab65 100644 --- a/hypha/static_src/src/sass/public/components/_form.scss +++ b/hypha/static_src/src/sass/public/components/_form.scss @@ -292,10 +292,10 @@ } &__help-link { - a{ + a { &:hover { - cursor: pointer; - color: $color--darkest-blue; + cursor: pointer; + color: $color--darkest-blue; } } } -- GitLab