(function($, undefined) { "use strict"; window.VAMTAM = window.VAMTAM || {}; $(function() { $('body').vamtamColorPicker().vamtamBackgroundOption(); window.VAMTAM.upload.init(); $(document).on('change select', '[data-field-filter]', function() { var prefix = $(this).attr('data-field-filter'); var selected = $(':checked', this).val(); var others = $(this).closest('.vamtam-config-group').find('.' + prefix).filter(':not(.hidden)'); others.show().filter(':not(.' + prefix + '-' + selected + ')').hide(); }); $('[data-field-filter]').change(); $(document).on('change', '.social_icon_select_sites', function() { var wrap = $(this).closest('p').siblings('.social_icon_wrap'); wrap.children('p').hide(); $('option:selected', this).each(function() { wrap.find('.social_icon_' + $(this).val()).show(); }); }); $(document).on('change', '.num_shown', function() { var wrap = $(this).closest('p').siblings('.hidden_wrap'); wrap.children('div').hide(); $('.hidden_el:lt(' + $(this).val() + ')', wrap).show(); }); $('.metabox').each(function() { var meta_tabs = $('