1'use strict'; 2 3function initializeFormHelpers() { 4 function focusMovingLabels(e) { 5 e.target.classList.add('is-focused'); 6 } 7 function blurMovingLabels(e) { 8 e.target.classList.remove('is-focused'); 9 10 if (e.target.value !== "") { 11 e.target.classList.add('has-content'); 12 } else { 13 e.target.classList.remove('has-content'); 14 } 15 } 16 function resetForm(e) { 17 e.currentTarget.previousElementSibling.value = ''; 18 } 19 20 var fields = document.querySelectorAll('.field.has-movingLabel'); 21 var inputsWithReset = document.querySelectorAll('.has-removable-content > span.remove-button'); 22 23 fields.forEach(function(field) { 24 var input = field.querySelector('input.form-control'); 25 if (input.value !== "") { 26 input.classList.add('has-content'); 27 } 28 29 input.addEventListener('focus', focusMovingLabels); 30 input.addEventListener('blur', blurMovingLabels); 31 }); 32 inputsWithReset.forEach(function(but) { 33 but.addEventListener('click', resetForm) 34 }) 35 36} 37 38window.addEventListener('DOMContentLoaded', initializeFormHelpers);
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.