common.js
918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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();
});