Skip to:
Content

BuddyPress.org

Changeset 8021


Ignore:
Timestamp:
03/02/2014 07:32:27 PM (11 years ago)
Author:
djpaul
Message:

xProfile: change the field visibility JS to show/hide the controls immediately, rather than with a slide/fade transition.

This helps improve the perceived performance of the visibility
controls. The code quality of these parts of the JS has also been
improved.

Fixes #5439

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-loader.php

    r7904 r8021  
    304304        /** Versions **************************************************/
    305305
    306         $this->version    = '2.0-alpha-7752';
     306        $this->version    = '2.0-alpha-8020';
    307307        $this->db_version = 7892;
    308308
  • trunk/bp-members/admin/js/admin.js

    r8007 r8021  
    1 (function( $ ) {
     1( function( $ ) {
     2    // Profile Visibility Settings
    23
    3     /** Profile Visibility Settings *********************************/
    4     $('.visibility-toggle-link').on( 'click', function( event ) {
    5 
     4    $( '.visibility-toggle-link' ).on( 'click', function( event ) {
    65        event.preventDefault();
    76
    8         var toggle_div = $(this).parent();
    9 
    10         $(toggle_div).fadeOut( 600, function(){
    11             $(toggle_div).siblings('.field-visibility-settings').slideDown(400);
    12         });
    13 
     7        $( this ).parent().hide()
     8            .siblings( '.field-visibility-settings' ).show();
    149    } );
    1510
    16     $('.field-visibility-settings-close').on( 'click', function( event ) {
    17 
     11    $( '.field-visibility-settings-close' ).on( 'click', function( event ) {
    1812        event.preventDefault();
    1913
    20         var settings_div = $(this).parent();
    21         var vis_setting_text = settings_div.find('input:checked').parent().text();
     14        var settings_div = $(this).parent(),
     15        vis_setting_text = settings_div.find( 'input:checked' ).parent().text();
    2216
    23         settings_div.slideUp( 400, function() {
    24             settings_div.siblings('.field-visibility-settings-toggle').fadeIn(800);
    25             settings_div.siblings('.field-visibility-settings-toggle').children('.current-visibility-level').html(vis_setting_text);
    26         } );
    27 
    28         return false;
     17        settings_div.hide()
     18            .siblings( '.field-visibility-settings-toggle' )
     19                .children( '.current-visibility-level' ).text( vis_setting_text ).end()
     20            .show();
    2921    } );
    3022
    31 })(jQuery);
     23} )( jQuery );
    3224
    3325
  • trunk/bp-templates/bp-legacy/js/buddypress.js

    r8007 r8021  
    966966
    967967    /** Profile Visibility Settings *********************************/
    968     jq('.field-visibility-settings').hide();
    969     jq('.visibility-toggle-link').on( 'click', function() {
    970         var toggle_div = jq(this).parent();
    971 
    972         jq(toggle_div).fadeOut( 600, function(){
    973             jq(toggle_div).siblings('.field-visibility-settings').slideDown(400);
    974         });
    975 
    976         return false;
     968    jq( '.visibility-toggle-link' ).on( 'click', function( event ) {
     969        event.preventDefault();
     970
     971        jq( this ).parent().hide()
     972            .siblings( '.field-visibility-settings' ).show();
    977973    } );
    978974
    979     jq('.field-visibility-settings-close').on( 'click', function() {
    980         var settings_div = jq(this).parent();
    981         var vis_setting_text = settings_div.find('input:checked').parent().text();
    982 
    983         settings_div.slideUp( 400, function() {
    984             settings_div.siblings('.field-visibility-settings-toggle').fadeIn(800);
    985             settings_div.siblings('.field-visibility-settings-toggle').children('.current-visibility-level').html(vis_setting_text);
    986         } );
    987 
    988         return false;
     975    jq( '.field-visibility-settings-close' ).on( 'click', function( event ) {
     976        event.preventDefault();
     977
     978        var settings_div = jq( this ).parent(),
     979            vis_setting_text = settings_div.find( 'input:checked' ).parent().text();
     980
     981        settings_div.hide()
     982            .siblings( '.field-visibility-settings-toggle' )
     983                .children( '.current-visibility-level' ).text( vis_setting_text ).end()
     984            .show();
    989985    } );
    990986
Note: See TracChangeset for help on using the changeset viewer.