From a5e0352031781fb95e15dcd8b6eaff7bda608b88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 30 Dec 2020 21:18:12 +0100 Subject: [PATCH] modify animation speed of tooltips --- htdocs/core/js/lib_foot.js.php | 50 ++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php index d04379210a6..de19f674659 100644 --- a/htdocs/core/js/lib_foot.js.php +++ b/htdocs/core/js/lib_foot.js.php @@ -21,13 +21,27 @@ * \brief File that include javascript functions (included if option use_javascript activated) */ -if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); -if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1); -if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); -if (!defined('NOLOGIN')) define('NOLOGIN', 1); -if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', 1); -if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1); -if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); +if (!defined('NOREQUIRESOC')) { + define('NOREQUIRESOC', '1'); +} +if (!defined('NOCSRFCHECK')) { + define('NOCSRFCHECK', 1); +} +if (!defined('NOTOKENRENEWAL')) { + define('NOTOKENRENEWAL', 1); +} +if (!defined('NOLOGIN')) { + define('NOLOGIN', 1); +} +if (!defined('NOREQUIREMENU')) { + define('NOREQUIREMENU', 1); +} +if (!defined('NOREQUIREHTML')) { + define('NOREQUIREHTML', 1); +} +if (!defined('NOREQUIREAJAX')) { + define('NOREQUIREAJAX', '1'); +} session_cache_limiter('public'); @@ -36,8 +50,11 @@ require_once '../../main.inc.php'; // Define javascript type top_httphead('text/javascript; charset=UTF-8'); // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access. -if (empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate'); -else header('Cache-Control: no-cache'); +if (empty($dolibarr_nocache)) { + header('Cache-Control: max-age=10800, public, must-revalidate'); +} else { + header('Cache-Control: no-cache'); +} //var_dump($conf); @@ -46,15 +63,14 @@ else header('Cache-Control: no-cache'); 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)) -{ +if (empty($conf->dol_no_mouse_hover)) { print 'jQuery(".classfortooltip").tooltip({ - show: { collision: "flipfit", effect:\'toggle\', delay:50 }, - hide: { delay: 250 }, + show: { collision: "flipfit", effect:"toggle", delay:75, duration:150 }, + hide: { delay: 250, duration: 20 }, tooltipClass: "mytooltip", content: function () { console.log("Return title for popup"); - return $(this).prop(\'title\'); /* To force to get title as is */ + return $(this).prop("title"); /* To force to get title as is */ } });'."\n"; } @@ -79,8 +95,7 @@ print "});\n"; // Wrapper to manage dropdown -if (!defined('JS_JQUERY_DISABLE_DROPDOWN')) -{ +if (!defined('JS_JQUERY_DISABLE_DROPDOWN')) { print "\n/* JS CODE TO ENABLE dropdown (hamburger, linkto, ...) */\n"; print ' jQuery(document).ready(function () { @@ -149,8 +164,7 @@ if (!defined('JS_JQUERY_DISABLE_DROPDOWN')) } // Wrapper to manage document_preview -if ($conf->browser->layout != 'phone') -{ +if ($conf->browser->layout != 'phone') { print "\n/* JS CODE TO ENABLE document_preview */\n"; // Function document_preview is into header print ' jQuery(document).ready(function () {