permalink-manager-admin.js
35 lines
| 1 | jQuery(document).ready(function() { |
| 2 | |
| 3 | /* |
| 4 | * Tab navigation |
| 5 | */ |
| 6 | jQuery('#permalink-manager-tabs-nav a').on('click', function(){ |
| 7 | |
| 8 | // Disable current active tab in navigation |
| 9 | jQuery('#permalink-manager-tabs-nav .nav-tab-active').removeClass('nav-tab-active'); |
| 10 | jQuery('#permalink-manager-tabs .show').removeClass('show'); |
| 11 | |
| 12 | // Get current tab name |
| 13 | var tab_to_open = jQuery(this).data("tab"); |
| 14 | |
| 15 | // Add "active" class to the clicked tab |
| 16 | jQuery(this).addClass('nav-tab-active'); |
| 17 | jQuery('#permalink-manager-tabs div[data-tab="'+tab_to_open+'"]').addClass('show'); |
| 18 | |
| 19 | // Disable native click event |
| 20 | return false; |
| 21 | }); |
| 22 | |
| 23 | /* |
| 24 | * "Select all" checkbox |
| 25 | */ |
| 26 | jQuery('input[value="all"]').on('change', function() { |
| 27 | // Uncheck "Select all" |
| 28 | jQuery(this).prop('checked', false); |
| 29 | |
| 30 | jQuery(this).parents('.checkboxes').find('input[type="checkbox"]').not(this).each(function() { |
| 31 | jQuery(this).prop('checked', true); |
| 32 | }); |
| 33 | }); |
| 34 | |
| 35 | }); |