| @@ -1,0 +1,29 @@ | ||
| 1 | +(function ( $ ) { | |
| 2 | + | |
| 3 | + // Add-ons tabs | |
| 4 | + $('.automatorwp_page_automatorwp_add_ons .wp-filter a').on('click', function(e) { | |
| 5 | + e.preventDefault(); | |
| 6 | + | |
| 7 | + if( $(this).hasClass('current') ) { | |
| 8 | + return; | |
| 9 | + } | |
| 10 | + | |
| 11 | + var current = $(this).closest('.wp-filter').find('a.current'); | |
| 12 | + | |
| 13 | + // Toggle plugin cards visibility | |
| 14 | + $('.automatorwp-plugin-card.' + current.data('target')).hide(); | |
| 15 | + | |
| 16 | + $('.automatorwp-plugin-card.' + $(this).data('target')).fadeIn(250); | |
| 17 | + | |
| 18 | + // Toggle current class | |
| 19 | + current.removeClass('current'); | |
| 20 | + $(this).addClass('current'); | |
| 21 | + }); | |
| 22 | + | |
| 23 | + // Hide all plugins cards | |
| 24 | + $('.automatorwp-add-ons .automatorwp-plugin-card:not(.' + $('.automatorwp_page_automatorwp_add_ons .wp-filter a.current').data('target') + ')').hide(); | |
| 25 | + | |
| 26 | + // Trigger click on first tab | |
| 27 | + $('.automatorwp_page_automatorwp_add_ons .wp-filter a.current').trigger('click'); | |
| 28 | + | |
| 29 | +})( jQuery ); | |