Skip to:
Content

BuddyPress.org

Changeset 12528


Ignore:
Timestamp:
01/18/2020 12:42:34 PM (5 years ago)
Author:
imath
Message:

xProfile: fix JS Code standards in inline comments

Props passoniate

See #8215

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/admin/js/admin.js

    r11547 r12528  
    6060    holder.appendChild( newDiv );
    6161
    62     // re-initialize the sortable ui
     62    // Re-initialize the sortable ui.
    6363    enableSortableFieldOptions( forWhat );
    6464
    65     // set focus on newly created element
     65    // Set focus on newly created element.
    6666    document.getElementById(forWhat + '_option' + theId).focus();
    6767
     
    105105
    106106    document.getElementById( id ).style.display = 'none';
    107     // the field id is [fieldtype]option[iterator] and not [fieldtype]div[iterator]
     107    // The field id is [fieldtype]option[iterator] and not [fieldtype]div[iterator].
    108108    var field_id = id.replace( 'div', 'option' );
    109109    document.getElementById( field_id ).value = '';
     
    191191jQuery( document ).ready( function() {
    192192
    193     // Set focus in Field Title, if we're on the right page
     193    // Set focus in Field Title, if we're on the right page.
    194194    jQuery( '#bp-xprofile-add-field #title' ).focus();
    195195
     
    200200    } );
    201201
    202     // Set up deleting options ajax
     202    // Set up deleting options ajax.
    203203    jQuery( 'a.ajax-option-delete' ).on( 'click', function() {
    204204        var theId = this.id.split( '-' );
     
    214214    } );
    215215
    216     // Set up the sort order change actions
     216    // Set up the sort order change actions.
    217217    jQuery( '[id^="sort_order_"]' ).change(function() {
    218218        if ( jQuery( this ).val() !== 'custom' ) {
     
    223223    });
    224224
    225     // Show object if JS is enabled
     225    // Show object if JS is enabled.
    226226    jQuery( 'ul#field-group-tabs' ).show();
    227227
    228     // Allow reordering of field group tabs
     228    // Allow reordering of field group tabs.
    229229    jQuery( 'ul#field-group-tabs' ).sortable( {
    230230        cursor: 'move',
     
    245245    }).disableSelection();
    246246
    247     // Allow reordering of fields within groups
     247    // Allow reordering of fields within groups.
    248248    jQuery( 'fieldset.field-group' ).sortable({
    249249        cursor: 'move',
     
    264264    })
    265265
    266     // Disallow text selection
     266    // Disallow text selection.
    267267    .disableSelection();
    268268
    269     // Allow reordering of field options
     269    // Allow reordering of field options.
    270270    enableSortableFieldOptions( jQuery('#fieldtype :selected').val() );
    271271
    272     // Handle title placeholder text the WordPress way
     272    // Handle title placeholder text the WordPress way.
    273273    titleHint( 'title' );
    274274
     
    314314    } );
    315315
    316     // tabs init with a custom tab template and an "add" callback filling in the content
     316    // tabs init with a custom tab template and an "add" callback filling in the content.
    317317    var $tab_items,
    318318        $tabs = jQuery( '#tabs' ).tabs();
     
    328328            tolerance: 'pointer',
    329329
    330             // When field is dropped on tab
     330            // When field is dropped on tab.
    331331            drop: function( ev, ui ) {
    332332                var $item = jQuery(this), // The tab
    333333                    $list = jQuery( $item.find( 'a' ).attr( 'href' ) ).find( '.connectedSortable' ); // The tab body
    334334
    335                 // Remove helper class
     335                // Remove helper class.
    336336                jQuery($item).removeClass( 'drop-candidate' );
    337337
    338                 // Hide field, change selected tab, and show new placement
     338                // Hide field, change selected tab, and show new placement.
    339339                ui.draggable.hide( 'slow', function() {
    340340
    341                     // Select new tab as current
     341                    // Select new tab as current.
    342342                    $tabs.tabs( 'option', 'active', $tab_items.index( $item ) );
    343343
    344                     // Show new placement
     344                    // Show new placement.
    345345                    jQuery(this).appendTo($list).show( 'slow' ).animate( {opacity: '1'}, 500 );
    346346
    347                     // Refresh $list variable
     347                    // Refresh $list variable.
    348348                    $list = jQuery( $item.find( 'a' ).attr( 'href' ) ).find( '.connectedSortable' );
    349349                    jQuery($list).find( 'p.nofields' ).hide( 'slow' );
    350350
    351                     // Ajax update field locations and orders
     351                    // Ajax update field locations and orders.
    352352                    jQuery.post( ajaxurl, {
    353353                        action: 'xprofile_reorder_fields',
Note: See TracChangeset for help on using the changeset viewer.