Ticket #7348: 7348-visibility-toggle-button.patch
File 7348-visibility-toggle-button.patch, 3.9 KB (added by , 7 years ago) |
---|
-
src/bp-templates/bp-legacy/buddypress/members/register.php
182 182 do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); 183 183 184 184 if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> 185 <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> 185 <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"><span id="<?php bp_the_profile_field_input_name(); ?>-2"> 186 186 <?php 187 187 printf( 188 188 __( 'This field can be seen by: %s', 'buddypress' ), … … 189 189 '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>' 190 190 ); 191 191 ?> 192 <button type="button" class="visibility-toggle-link"><?php _ex( 'Change', 'Change profile field visibility level', 'buddypress' ); ?></button> 192 </span> 193 <button type="button" class="visibility-toggle-link" aria-describedby="<?php bp_the_profile_field_input_name(); ?>-2" aria-expanded="false"><?php _ex( 'Change', 'Change profile field visibility level', 'buddypress' ); ?></button> 193 194 </p> 194 195 195 196 <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>"> -
src/bp-templates/bp-legacy/buddypress/members/single/profile/edit.php
52 52 ?> 53 53 54 54 <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> 55 <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> 55 <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"><span id="<?php bp_the_profile_field_input_name(); ?>-2"> 56 56 <?php 57 57 printf( 58 58 __( 'This field can be seen by: %s', 'buddypress' ), … … 59 59 '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>' 60 60 ); 61 61 ?> 62 <button type="button" class="visibility-toggle-link"><?php _e( 'Change', 'buddypress' ); ?></button> 62 </span> 63 <button type="button" class="visibility-toggle-link" aria-describedby="<?php bp_the_profile_field_input_name(); ?>-2" aria-expanded="false"><?php _ex( 'Change', 'Change profile field visibility level', 'buddypress' ); ?></button> 63 64 </p> 64 65 65 66 <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>"> -
src/bp-templates/bp-legacy/js/buddypress.js
1187 1187 jq( '.visibility-toggle-link' ).on( 'click', function( event ) { 1188 1188 event.preventDefault(); 1189 1189 1190 jq( this ). parent().hide().addClass( 'field-visibility-settings-hide' )1190 jq( this ).attr( 'aria-expanded', 'true' ).parent().hide().addClass( 'field-visibility-settings-hide' ) 1191 1191 .siblings( '.field-visibility-settings' ).show().addClass( 'field-visibility-settings-open' ); 1192 1192 } ); 1193 1193 … … 1194 1194 jq( '.field-visibility-settings-close' ).on( 'click', function( event ) { 1195 1195 event.preventDefault(); 1196 1196 1197 jq( '.visibility-toggle-link' ).attr( 'aria-expanded', 'false' ); 1198 1197 1199 var settings_div = jq( this ).parent(), 1198 1200 vis_setting_text = settings_div.find( 'input:checked' ).parent().text(); 1199 1201