diff --git a/js/functions.js b/js/functions.js index 2bc9f90911..0a51657be8 100644 --- a/js/functions.js +++ b/js/functions.js @@ -3471,6 +3471,35 @@ function PMA_createqTip($elements, content, options) $elements.qtip($.extend(true, o, options)); } +/** + * Create a jQuery UI tooltip + * + * @param $elements jQuery object representing the elements + * @param item the item + * (see http://api.jqueryui.com/tooltip/#option-items) + * @param myContent content of the tooltip + * @param additional_options to override the default options + * + */ +function PMA_tooltip($elements, item, myContent, additional_options) +{ + if ($('#no_hint').length > 0) { + return; + } + + var default_options = { + content: myContent, + items: item, + //@todo: when PMA_createqTip() is gone, rename this class + tooltipClass: "normalqTip", + track: true, + show: {effect: "slideDown", duration: 250}, + hide: {effect: "slideUp", duration: 250} + } + + $elements.tooltip($.extend(true, default_options, additional_options)); +} + /** * Return value of a cell in a table. */ diff --git a/js/server_status_variables.js b/js/server_status_variables.js index a8c2e652a7..f6ce73d2f4 100644 --- a/js/server_status_variables.js +++ b/js/server_status_variables.js @@ -17,10 +17,7 @@ AJAX.registerTeardown('server_status_variables.js', function() { AJAX.registerOnload('server_status_variables.js', function() { /*** Table sort tooltip ***/ - PMA_createqTip( - $('table.sortable').children('thead').children('tr').has('th'), - PMA_messages['strSortHint'] - ); + PMA_tooltip($('table.sortable>thead>tr:first').find('th'), 'th', PMA_messages['strSortHint']); initTableSorter('statustabs_allvars'); // Filters for status variables