diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 41ac0391168..5dd29b8def4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -551,11 +551,11 @@ class Form { if ($type == 'info' || $type == 'help') return $text; } - // If info or help with smartphone, show only text (tooltip on lick does not works with dialog on smaprtphone) - if (! empty($conf->dol_no_mouse_hover) && ! empty($tooltiptrigger)) - { - if ($type == 'info' || $type == 'help') return $text; - } + // If info or help with smartphone, show only text (tooltip on click does not works with dialog on smaprtphone) + //if (! empty($conf->dol_no_mouse_hover) && ! empty($tooltiptrigger)) + //{ + //if ($type == 'info' || $type == 'help') return ''.$text.'''; + //} $img=''; if ($type == 'info') $img = img_help(0, $alt); diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php index cfa05289f4b..ad6592e1413 100644 --- a/htdocs/core/js/lib_foot.js.php +++ b/htdocs/core/js/lib_foot.js.php @@ -43,37 +43,40 @@ else header('Cache-Control: no-cache'); // Wrapper to show tooltips (html or onclick popup) +print "\n/* JS CODE TO ENABLE Tooltips on all object with class classfortooltip */\n"; +print "jQuery(document).ready(function () {\n"; + if (empty($conf->dol_no_mouse_hover)) { - print "\n/* JS CODE TO ENABLE Tooltips on all object with class classfortooltip */\n"; - print ' - jQuery(document).ready(function () { - jQuery(".classfortooltip").tooltip({ - show: { collision: "flipfit", effect:\'toggle\', delay:50 }, - hide: { delay: 50 }, - tooltipClass: "mytooltip", - content: function () { - return $(this).prop(\'title\'); /* To force to get title as is */ - } - }); - jQuery(".classfortooltiponclicktext").dialog( - { closeOnEscape: true, classes: { "ui-dialog": "highlight" }, - maxHeight: window.innerHeight-60, width: '.($conf->browser->layout == 'phone' ? 400 : 700).', - modal: true, - autoOpen: false }).css("z-index: 5000"); - jQuery(".classfortooltiponclick").click(function () { - console.log("We click on tooltip for element with dolid="+$(this).attr(\'dolid\')); - if ($(this).attr(\'dolid\')) - { - obj=$("#idfortooltiponclick_"+$(this).attr(\'dolid\')); /* obj is a div component */ - obj.dialog("open"); - return false; - } - }); - }); - ' . "\n"; + print 'jQuery(".classfortooltip").tooltip({ + show: { collision: "flipfit", effect:\'toggle\', delay:50 }, + hide: { delay: 50 }, + tooltipClass: "mytooltip", + content: function () { + return $(this).prop(\'title\'); /* To force to get title as is */ + } + });'."\n"; } +print ' +jQuery(".classfortooltiponclicktext").dialog( + { closeOnEscape: true, classes: { "ui-dialog": "highlight" }, + maxHeight: window.innerHeight-60, width: '.($conf->browser->layout == 'phone' ? max($_SESSION['dol_screenwidth']-20, 320) : 700).', + modal: true, + autoOpen: false }).css("z-index: 5000"); +jQuery(".classfortooltiponclick").click(function () { + console.log("We click on tooltip for element with dolid="+$(this).attr(\'dolid\')); + if ($(this).attr(\'dolid\')) + { + obj=$("#idfortooltiponclick_"+$(this).attr(\'dolid\')); /* obj is a div component */ + obj.dialog("open"); + return false; + } +});'."\n"; + +print "});\n"; + + // Wrapper to manage dropdown if (! defined('JS_JQUERY_DISABLE_DROPDOWN')) { diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 5b909c6e148..3dc43d7dcf2 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -816,7 +816,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, /** - * Function to output a dialog bog for copy/paste + * Function to output a dialog box for copy/paste * * @param string text Text to put into copy/paste area * @param string text2 Text to put under the copy/paste area diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 2f81d361637..60b4e4e20cb 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2132,7 +2132,14 @@ if (! GETPOST('hide_websitemenu')) if (GETPOST('editsource', 'alpha') || GETPOST('editcontent', 'alpha')) { $htmltext=$langs->transnoentitiesnoconv("YouCanEditHtmlSource").'
'; - print $form->textwithpicto($langs->trans("SyntaxHelp"), $htmltext, 1, 'help', 'inline-block', 1, 2, 'tooltipsubstitution'); + if ($conf->browser->layout == 'phone') + { + print $form->textwithpicto('', $htmltext, 1, 'help', 'inline-block', 1, 2, 'tooltipsubstitution'); + } + else + { + print $form->textwithpicto($langs->trans("SyntaxHelp"), $htmltext, 1, 'help', 'inline-block', 1, 2, 'tooltipsubstitution'); + } } print ''; // end websitehelp