1/*1705925424000*/ 2function findObjectKey(obj, value) { 3 4 var result = false; 5 if (value){ 6 7 var vals = []; 8 for (var key in obj) { 9 if (obj.hasOwnProperty(key) && obj.propertyIsEnumerable(key)) { 10 11 if (key === value){ 12 result = true; 13 break; 14 } 15 } 16 } 17 } 18 return result; 19} 20 21function setFocusFirstInvalidField(formId) { 22 var elementsForm = document.getElementById(formId).elements; 23 24 var validator = Liferay.Form._INSTANCES[formId].formValidator; 25 if (!validator.validate()) { 26 27 var _listError = validator.errors; 28 29 30 for (var i = 0, element; element = elementsForm[i++];) { 31 //If the item is in the error list, 32 // we set the focus to the first occurrence 33 if (findObjectKey(_listError,element.id)){ 34 document.getElementById(element.id).focus(); 35 //For IE Browsers, add 'focused' class to stick a 36 // validator message in the first field that contains an error 37 $('#'+element.id).parent('.ie .has-error').addClass('focused'); 38 $('#'+element.id).on('blur', function(){ 39 $(this).parent('.ie .has-error').removeClass('focused'); 40 }); 41 var center = $(window).height()/2; 42 var top = $('#'+element.id).offset().top ; 43 if (top > center){ 44 $(window).scrollTop(top-center); 45 } 46 break; 47 } 48 } 49 } 50} 51//For IE Browsers, add 'focused' class to stick a 52// validator message in the active field that contains an error 53$(document).ready(function(){ 54 $('.ie .field').on('focus', function(){ 55 $(this).parent('.ie .has-error').addClass('focused'); 56 }); 57 $('.ie .field').on('blur', function(){ 58 $(this).parent('.ie .has-error').removeClass('focused'); 59 }); 60});
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.