META-INF.resources.textinputeffects.textinputeffects.min.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jwebmp-text-input-effects Show documentation
Show all versions of jwebmp-text-input-effects Show documentation
The JWebSwing implementation for the Text Input Effects collection
(function(){if(!String.prototype.trim){(function(){var rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;String.prototype.trim=function(){return this.replace(rtrim,"")}})()}[].slice.call(document.querySelectorAll("input.input__field")).forEach(function(inputEl){if(inputEl.value.trim()!==""){classie.add(inputEl.parentNode,"input--filled")}inputEl.addEventListener("focus",onInputFocus);inputEl.addEventListener("blur",onInputBlur)});function onInputFocus(ev){classie.add(ev.target.parentNode,"input--filled")}function onInputBlur(ev){if(ev.target.value.trim()===""){classie.remove(ev.target.parentNode,"input--filled")}}})();