diff --git a/js/functions.js b/js/functions.js index 898389efe9..bf695367c3 100644 --- a/js/functions.js +++ b/js/functions.js @@ -2702,3 +2702,42 @@ $(document).ready(function() { }; //end noSelect })(jQuery); +/** + * Create default PMA tooltip for the element specified. The default appearance + * can be overriden by specifying optional "options" parameter (see qTip options). + */ +function PMA_createqTip($elements, content, options) { + var o = { + content: content, + style: { + background: '#333', + border: { + radius: 5 + }, + fontSize: '0.8em', + padding: '0 0.5em', + name: 'dark' + }, + position: { + target: 'mouse', + corner: { target: 'rightMiddle', tooltip: 'leftMiddle' }, + adjust: { x: 20 } + }, + show: { + delay: 0, + effect: { + type: 'grow', + length: 100 + } + }, + hide: { + effect: { + type: 'grow', + length: 150 + } + } + } + + $elements.qtip($.extend(true, o, options)); +} + diff --git a/js/makegrid.js b/js/makegrid.js index 43955c7eea..3fb22466c2 100644 --- a/js/makegrid.js +++ b/js/makegrid.js @@ -593,15 +593,7 @@ }); // create qtip for each with draggable class - $(t).find('th.draggable').qtip({ - style: { - tip: true, - name: 'dark' - }, - position: { - corner: { target: 'topRight', tooltip: 'bottomLeft' } - } - }); + PMA_createqTip($(t).find('th.draggable')); // register events if (g.reorderHint) { // make sure columns is reorderable @@ -626,17 +618,10 @@ }); } if ($firstRowCols.length > 1) { - $(t).find('th:not(.draggable)') - .qtip({ - style: { - tip: true, - name: 'dark' - }, - position: { - corner: { target: 'topRight', tooltip: 'bottomLeft' } - } - }) - .mouseenter(function(e) { + var $colVisibTh = $(t).find('th:not(.draggable)'); + + PMA_createqTip($colVisibTh); + $colVisibTh.mouseenter(function(e) { g.showColVisibHint = true; g.showHint(e); })