Files
ultimatemember/assets/js/admin/common.js
T
Mykyta Synelnikov 10d580908a - wp-admin assets refactoring (in process);
- partially frontend scripts review related to the form builder preview;
2023-11-07 11:34:32 +02:00

43 lines
918 B
JavaScript

if ( typeof (window.UM) !== 'object' ) {
window.UM = {};
}
if ( typeof (window.UM.admin) !== 'object' ) {
window.UM.admin = {};
}
UM.admin = {
tooltip: {
all: null,
init: function() {
let $tooltip = jQuery( '.um_tooltip' );
if ( $tooltip.length > 0 ) {
UM.admin.tooltip.all = $tooltip.tooltip({
tooltipClass: "um_tooltip",
content: function () {
return jQuery( this ).attr( 'title' );
}
});
}
},
close: function () {
if ( null !== UM.admin.tooltip.all && UM.admin.tooltip.all > 0 && 'function' === typeof UM.admin.tooltip.all.tooltip ) {
UM.admin.tooltip.all.tooltip('close');
}
}
},
colorPicker: {
init: function () {
let $colorPicker = jQuery('.um-admin-colorpicker');
if ( $colorPicker.length ) {
$colorPicker.wpColorPicker();
}
}
}
}
jQuery(document).ready(function() {
UM.admin.tooltip.init();
UM.admin.colorPicker.init();
});