N°1727: Fix non disappearing tooltip for mandatory HTML field

This commit is contained in:
Stephen Abello
2018-11-12 17:42:56 +01:00
parent 6b5f32611d
commit 36ade3b15c

View File

@@ -202,13 +202,17 @@ function ReportFieldValidationStatus(sFieldId, sFormId, bValid, sExplain)
}
// Visual feedback
$('#v_'+sFieldId).html('<img src="../images/validation_error.png" style="vertical-align:middle" data-tooltip="'+sExplain+'"/>');
$('#v_'+sFieldId).tooltip({
items: 'span',
tooltipClass: 'form_field_error',
content: function() {
return $(this).find('img').attr('data-tooltip'); // As opposed to the default 'content' handler, do not escape the contents of 'title'
}
});
//Avoid replacing exisiting tooltip for periodically checked element (like CKeditor fields)
if($('#v_'+sFieldId).tooltip( "instance" ) === undefined)
{
$('#v_'+sFieldId).tooltip({
items: 'span',
tooltipClass: 'form_field_error',
content: function() {
return $(this).find('img').attr('data-tooltip'); // As opposed to the default 'content' handler, do not escape the contents of 'title'
}
});
}
}
}