From 36ade3b15cacfe072bc5422b1a1338e98607aff0 Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Mon, 12 Nov 2018 17:42:56 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B01727:=20Fix=20non=20disappearing=20toolt?= =?UTF-8?q?ip=20for=20mandatory=20HTML=20field?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/forms-json-utils.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/js/forms-json-utils.js b/js/forms-json-utils.js index 0e0602119..add2ace78 100644 --- a/js/forms-json-utils.js +++ b/js/forms-json-utils.js @@ -202,13 +202,17 @@ function ReportFieldValidationStatus(sFieldId, sFormId, bValid, sExplain) } // Visual feedback $('#v_'+sFieldId).html(''); - $('#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' + } + }); + } } }