catch-scroll-progress-bar-admin.js
1 month ago
jquery-matchHeight.min.js
1 month ago
our-themes.js
1 month ago
wp-color-picker.js
1 month ago
catch-scroll-progress-bar-admin.js
59 lines
| 1 | jQuery(function ($) { |
| 2 | /* CPT switch */ |
| 3 | $('.ctp-switch').on('click', function () { |
| 4 | var loader = $(this).parent().next(); |
| 5 | |
| 6 | loader.show(); |
| 7 | |
| 8 | var main_control = $(this); |
| 9 | var data = { |
| 10 | action: 'ctp_switch', |
| 11 | value: this.checked, |
| 12 | security: $('#ctp_tabs_nonce').val(), |
| 13 | option_name: main_control.attr('rel'), |
| 14 | }; |
| 15 | |
| 16 | $.post(ajaxurl, data, function (response) { |
| 17 | response = $.trim(response); |
| 18 | |
| 19 | if ('1' == response) { |
| 20 | main_control.parent().parent().addClass('active'); |
| 21 | main_control.parent().parent().removeClass('inactive'); |
| 22 | } else if ('0' == response) { |
| 23 | main_control.parent().parent().addClass('inactive'); |
| 24 | main_control.parent().parent().removeClass('active'); |
| 25 | } else { |
| 26 | alert(response); |
| 27 | } |
| 28 | loader.hide(); |
| 29 | }); |
| 30 | }); |
| 31 | /* CPT switch End */ |
| 32 | |
| 33 | // Tabs |
| 34 | $('.catchp_widget_settings .nav-tab-wrapper a').on('click', function (e) { |
| 35 | e.preventDefault(); |
| 36 | if (!$(this).hasClass('ui-state-active')) { |
| 37 | $('.nav-tab').removeClass('nav-tab-active'); |
| 38 | $('.wpcatchtab').removeClass('active').fadeOut(0); |
| 39 | |
| 40 | $(this).addClass('nav-tab-active'); |
| 41 | |
| 42 | var anchorAttr = $(this).attr('href'); |
| 43 | |
| 44 | $(anchorAttr).addClass('active').fadeOut(0).fadeIn(500); |
| 45 | } |
| 46 | }); |
| 47 | |
| 48 | // jQuery Match Height init for sidebar spots |
| 49 | $(document).ready(function () { |
| 50 | $( |
| 51 | '.catchp-sidebar-spot .sidebar-spot-inner, .col-2 .catchp-lists li, .col-3 .catchp-lists li' |
| 52 | ).matchHeight(); |
| 53 | }); |
| 54 | // jQuery UI Tooltip initializaion |
| 55 | $(document).ready(function () { |
| 56 | $('.tooltip').tooltip(); |
| 57 | }); |
| 58 | }); |
| 59 |