@@ -6,6 +6,7 @@ import { mysqlDocKeyword, mysqlDocBuiltin } from './doc-links.js';
66import { Indexes } from './indexes.js' ;
77import { Config } from './config.js' ;
88import { resizeTopMenu } from './menu-resizer.js' ;
9+ import tooltip from './tooltip.js' ;
910
1011/* global ChartType, ColumnType, DataTable, JQPlotChartFactory */ // js/chart.js
1112/* global DatabaseStructure */ // js/database/structure.js
@@ -198,7 +199,7 @@ Functions.addDatepicker = function ($thisElement, type, options) {
198199 if ( type === 'time' ) {
199200 $thisElement . timepicker ( $ . extend ( defaultOptions , options ) ) ;
200201 // Add a tip regarding entering MySQL allowed-values for TIME data-type
201- Functions . tooltip ( $thisElement , 'input' , window . Messages . strMysqlAllowedValuesTipTime ) ;
202+ tooltip ( $thisElement , 'input' , window . Messages . strMysqlAllowedValuesTipTime ) ;
202203 } else {
203204 $thisElement . datetimepicker ( $ . extend ( defaultOptions , options ) ) ;
204205 }
@@ -242,9 +243,9 @@ Functions.addDateTimePicker = function () {
242243 // Add a tip regarding entering MySQL allowed-values
243244 // for TIME and DATE data-type
244245 if ( $ ( this ) . hasClass ( 'timefield' ) ) {
245- Functions . tooltip ( $ ( this ) , 'input' , window . Messages . strMysqlAllowedValuesTipTime ) ;
246+ tooltip ( $ ( this ) , 'input' , window . Messages . strMysqlAllowedValuesTipTime ) ;
246247 } else if ( $ ( this ) . hasClass ( 'datefield' ) ) {
247- Functions . tooltip ( $ ( this ) , 'input' , window . Messages . strMysqlAllowedValuesTipDate ) ;
248+ tooltip ( $ ( this ) , 'input' , window . Messages . strMysqlAllowedValuesTipDate ) ;
248249 }
249250 } ) ;
250251 }
@@ -364,33 +365,6 @@ Functions.clearSelection = function () {
364365 }
365366} ;
366367
367- /**
368- * Create a jQuery UI tooltip
369- *
370- * @param $elements jQuery object representing the elements
371- * @param item the item
372- * (see https://api.jqueryui.com/tooltip/#option-items)
373- * @param myContent content of the tooltip
374- * @param additionalOptions to override the default options
375- *
376- */
377- Functions . tooltip = function ( $elements , item , myContent , additionalOptions ) {
378- if ( $ ( '#no_hint' ) . length > 0 ) {
379- return ;
380- }
381-
382- var defaultOptions = {
383- content : myContent ,
384- items : item ,
385- tooltipClass : 'tooltip' ,
386- track : true ,
387- show : false ,
388- hide : false
389- } ;
390-
391- $elements . uiTooltip ( $ . extend ( true , defaultOptions , additionalOptions ) ) ;
392- } ;
393-
394368/**
395369 * @param {string } value
396370 * @return {string }
@@ -1675,11 +1649,7 @@ Functions.ajaxShowMessage = function (message = null, timeout = null, type = nul
16751649 * Add a tooltip to the notification to let the user know that they
16761650 * can dismiss the ajax notification by clicking on it.
16771651 */
1678- Functions . tooltip (
1679- $retval ,
1680- 'span' ,
1681- window . Messages . strDismiss
1682- ) ;
1652+ tooltip ( $retval , 'span' , window . Messages . strDismiss ) ;
16831653 }
16841654 // Hide spinner if this is not a loading message
16851655 if ( msg !== window . Messages . strLoading ) {
@@ -3293,11 +3263,7 @@ Functions.showHints = function ($div) {
32933263 $newDiv = $ ( 'body' ) ;
32943264 }
32953265 $newDiv . find ( '.pma_hint' ) . each ( function ( ) {
3296- Functions . tooltip (
3297- $ ( this ) . children ( 'img' ) ,
3298- 'img' ,
3299- $ ( this ) . children ( 'span' ) . html ( )
3300- ) ;
3266+ tooltip ( $ ( this ) . children ( 'img' ) , 'img' , $ ( this ) . children ( 'span' ) . html ( ) ) ;
33013267 } ) ;
33023268} ;
33033269
0 commit comments