https://careers.bmc.org/assets/sites/controllers/call_to_action/job_questions_controller-06c32d9e.js
1import {Controller} from '@hotwired/stimulus' 2 3//TODO: This is a quick fix - rewrite this by splitting it up 4export default class extends Controller { 5 connect() { 6 this.bindSelectsWithSupportTextInput() 7 this.bindCheckboxesWithSupportTextInput() 8 } 9 10 bindSelectsWithSupportTextInput() { 11 this.onChooseOfQuestionOption('select.form-control', 'change', (selectElement) => selectElement.options[selectElement.selectedIndex].dataset.supportsTextInput === 'true') 12 } 13 14 bindCheckboxesWithSupportTextInput() { 15 this.onChooseOfQuestionOption('input[type="checkbox"][data-supports-text-input="true"]', 'click', (checkboxElement) => checkboxElement.checked) 16 } 17 18 toggleTextInput(textInputElement, showTextInput) { 19 if (showTextInput) { 20 textInputElement.disabled = false 21 textInputElement.classList.remove('d-none') 22 } else { 23 textInputElement.disabled = true 24 textInputElement.classList.add('d-none') 25 } 26 } 27 28 onChooseOfQuestionOption(selector, eventType, supportsTextInputHandler) { 29 for (const jobQuestionElement of this.element.querySelectorAll(`.form-template-field-question-set-demographic-questions ${selector}`)) { 30 const textInputElement = jobQuestionElement.nextElementSibling 31 if (textInputElement) { 32 jobQuestionElement.addEventListener('change', (e) => { 33 const supportsTextInput = supportsTextInputHandler(jobQuestionElement) 34 this.toggleTextInput(textInputElement, supportsTextInput) 35 }) 36 } 37 } 38 } 39}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.