sS hjs_autoExpandingTextAreas() { ret hjs([[ var autoExpandTextarea = function (field) { // Reset field height field.style.height = 'inherit'; // Get the computed styles for the element var computed = window.getComputedStyle(field); field.style.height = "1px"; // Calculate the height var height = /*parseInt(computed.getPropertyValue('border-top-width'), 10) + parseInt(computed.getPropertyValue('padding-top'), 10) +*/ field.scrollHeight /*+ parseInt(computed.getPropertyValue('padding-bottom'), 10) + parseInt(computed.getPropertyValue('border-bottom-width'), 10)*/; field.style.height = height + 'px'; }; document.addEventListener('input', function (event) { if (event.target.tagName.toLowerCase() !== 'textarea') return; if (!event.target.classList.contains("auto-expand")) return; autoExpandTextarea(event.target); }, false); ]]); }