diff --git a/.eslintrc b/.eslintrc index d44fdbcb02b..61a5d2966ea 100644 --- a/.eslintrc +++ b/.eslintrc @@ -36,7 +36,6 @@ 'app/pw-toggle', 'app/form-validation', 'app/form-field-format', - 'app/idv-finance-helper', 'app/radio-btn', 'app/print-personal-key', 'app/utils/ms-formatter', diff --git a/app/assets/javascripts/app/form-field-format.js b/app/assets/javascripts/app/form-field-format.js index b03ee377608..8f13ce3e031 100644 --- a/app/assets/javascripts/app/form-field-format.js +++ b/app/assets/javascripts/app/form-field-format.js @@ -9,12 +9,8 @@ import ZipCodeFormatter from './modules/zip-code-formatter'; function formatForm() { const formats = [ - ['.auto_loan', new NumericFormatter()], - ['.ccn', new NumericFormatter()], ['.dob', new DateFormatter()], - ['.home_equity_line', new NumericFormatter()], ['.mfa', new NumericFormatter()], - ['.mortgage', new NumericFormatter()], ['.phone', new InternationalPhoneFormatter()], ['.us-phone', new USPhoneFormatter()], ['.personal-key', new PersonalKeyFormatter()], diff --git a/app/assets/javascripts/app/idv-finance-helper.js b/app/assets/javascripts/app/idv-finance-helper.js deleted file mode 100644 index 62b091d069a..00000000000 --- a/app/assets/javascripts/app/idv-finance-helper.js +++ /dev/null @@ -1,45 +0,0 @@ -import 'classlist.js'; - -document.addEventListener('DOMContentLoaded', () => { - function hideAll(elems) { - Array.prototype.forEach.call(elems, (el) => { - el.classList.add('hide'); - }); - } - - function removeError() { - const errorMessage = document.querySelector('.error-message'); - - if (errorMessage) { - errorMessage.parentNode.classList.remove('has-error'); - errorMessage.parentNode.removeChild(errorMessage); - } - } - - function showInput(name) { - const inputWrappers = document.querySelectorAll('.js-finance-wrapper'); - hideAll(inputWrappers); - - const inputWrapperToShow = document.querySelector(`[data-type="${name}"]`); - if (inputWrapperToShow) { - inputWrapperToShow.classList.remove('hide'); - } - } - - const financeSelect = document.querySelector('.js-finance-choice-select'); - const submitButton = document.querySelector('.js-finance-submit'); - - if (financeSelect) { - const inputWrappers = document.querySelectorAll('.js-finance-wrapper'); - hideAll(inputWrappers); - - showInput(financeSelect.value || 'blank'); - submitButton.disabled = !financeSelect.value; - - financeSelect.addEventListener('change', () => { - removeError(); - showInput(financeSelect.value || 'blank'); - submitButton.disabled = !financeSelect.value; - }); - } -}); diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 64d07a2fd48..ea4090b8662 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -3,7 +3,6 @@ import 'app/utils/index'; import 'app/pw-toggle'; import 'app/form-validation'; import 'app/form-field-format'; -import 'app/idv-finance-helper'; import 'app/radio-btn'; import 'app/phone-internationalization'; import 'app/print-personal-key'; diff --git a/app/assets/stylesheets/components/_form.scss b/app/assets/stylesheets/components/_form.scss index 71df7c2435c..422f3245b9a 100644 --- a/app/assets/stylesheets/components/_form.scss +++ b/app/assets/stylesheets/components/_form.scss @@ -156,117 +156,3 @@ input::-webkit-inner-spin-button { background-color: $gray-light; border-color: $gray; } - -.select-alt { - color: $white; - display: inline-block; - position: relative; - width: 100%; - - select { - -moz-appearance: none; - -webkit-appearance: none; - appearance: none; - background-color: $navy; - border-right: 1px solid $blue; - color: $white; - cursor: pointer; - display: inline-block; - font-weight: normal; - line-height: 1.5; - padding-right: 2.25rem; - width: 100%; - } - - // Undo the Firefox inner focus ring - select:focus:-moz-focusring { - color: transparent; - text-shadow: 0 0 0 $white; - } - - select:active { - background-color: $navy; - color: $white; - } - - // Hide the arrow in IE10 and up - select::-ms-expand { - display: none; - } - - // Separator - &::before { - border-right: 1px solid $blue; - content: ''; - height: -moz-calc(3rem - 2px); - height: -webkit-calc(3rem - 2px); - height: calc(3rem - 2px); - position: absolute; - right: 3rem; - top: 1px; - width: 0; - } - - // Dropdown arrow - &::after { - border-bottom: .35rem solid transparent; - border-left: .35rem solid transparent; - border-right: .35rem solid transparent; - border-top: .35rem solid; - content: ''; - display: inline-block; - height: 0; - margin-top: -.15rem; - pointer-events: none; - position: absolute; - right: 1.25rem; - top: 50%; - width: 0; - } -} - -// Media query to target Firefox only -@-moz-document url-prefix() { - // Firefox hack to hide the arrow - .select-alt select { - padding-right: 1rem; - text-indent: .01px; - text-overflow: ''; - } - - //