PluginProbe
Members – Membership & User Role Editor Plugin / 3.2.24
Members – Membership & User Role Editor Plugin v3.2.24
3.2.25 3.2.26 3.2.24 3.2.23 3.2.22 3.2.21 trunk 0.1 0.1.1 0.2 0.2.1 0.2.2 0.2.3 0.2.4 0.2.5 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.1.3 2.0.0 2.0.1 2.0.2 All 66 releases
members / js / edit-post.js

edit-post.js in Members – Membership & User Role Editor Plugin 3.2.24, at js/edit-post.js

40 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 ( function() {
2
3 /* ====== Tabs ====== */
4
5 // Hides the tab content.
6 jQuery( '.members-tabs .members-tab-content' ).hide();
7
8 // Shows the first tab's content.
9 jQuery( '.members-tabs .members-tab-content:first-child' ).show();
10
11 // Makes the 'aria-selected' attribute true for the first tab nav item.
12 jQuery( '.members-tab-nav :first-child' ).attr( 'aria-selected', 'true' );
13
14 // When a tab nav item is clicked.
15 jQuery( '.members-tab-nav li a' ).on(
16 'click',
17 function( j ) {
18
19 // Prevent the default browser action when a link is clicked.
20 j.preventDefault();
21
22 // Get the `href` attribute of the item.
23 var href = jQuery( this ).attr( 'href' );
24
25 // Hide all tab content.
26 jQuery( this ).parents( '.members-tabs' ).find( '.members-tab-content' ).hide();
27
28 // Find the tab content that matches the tab nav item and show it.
29 jQuery( this ).parents( '.members-tabs' ).find( href ).show();
30
31 // Set the `aria-selected` attribute to false for all tab nav items.
32 jQuery( this ).parents( '.members-tabs' ).find( '.members-tab-title' ).attr( 'aria-selected', 'false' );
33
34 // Set the `aria-selected` attribute to true for this tab nav item.
35 jQuery( this ).parent().attr( 'aria-selected', 'true' );
36 }
37 ); // click()
38
39 }() );
40