Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(document).ready(function($) {
- // Show/hide the thumbnails section
- $(document).on('change', 'input.tm_lcptu_show-thumbnails',
- function(event) {
- var id = $(this).attr('id');
- if($(this).attr('checked')) {
- $('.'+id).slideDown(100);
- return;
- }
- $('.'+id).slideUp(100);
- }
- );
- // Show/hide the advanced section
- $(document).on('change', 'input.tm_lcptu_show-advanced',
- function(event) {
- var id = $(this).attr('id');
- if($(this).attr('checked')) {
- $('.'+id).slideDown(100);
- return;
- }
- $('.'+id).slideUp(100);
- }
- );
- // Get the taxonomies and update them
- $(document).on('change', 'select.tm_lcptu_post-type', function(event) {
- var myClass = $(this).attr('id');
- var data = {
- action: 'tm_lcptu_tax',
- posttype: $(this).attr('value')
- };
- $.post(ajaxurl, data,
- function(response) {
- $('.'+myClass).html(response);
- $('.'+$('.'+myClass).attr('id')+'-container').slideUp(100);
- }
- );
- }
- );
- // Get the tags/categories and update them
- $(document).on('change', 'select.tm_lcptu_tax', function(event) {
- var myClass = $(this).attr('id');
- if($(this).attr('value') == '--')
- $('.'+myClass+'-container').slideUp(100);
- else {
- $('.'+myClass+'-container').slideDown(100);
- var data = {
- action: 'tm_lcptu_tags',
- taxonomy: $(this).attr('value'),
- checkboxName: $('.'+myClass).attr('id')
- };
- $.post(ajaxurl, data,
- function(response) {
- $('.'+myClass).html(response);
- }
- );
- }
- }
- );
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement