MDL-55417 theme_noname: Update mform templates to re-use javascript
[moodle.git] / theme / noname / amd / build / form-display-errors.min.js
1 define(["jquery","core/event"],function(a,b){return{enhance:function(c){var d=document.getElementById(c);a(d).on(b.Events.FORM_FIELD_VALIDATION,function(b,c){b.preventDefault();var e=a(d).closest(".form-group"),f=e.find(".form-control-feedback");""!==c?(e.addClass("has-danger"),a(d).addClass("form-control-danger"),a(d).attr("aria-describedby",a(d).attr("id")+"-feedback"),f.html(c),f.show()):(e.removeClass("has-danger"),a(d).removeClass("form-control-danger"),a(d).attr("aria-describedby",""),f.hide())})}}});