Skip to:
Content

BuddyPress.org

Changeset 12522


Ignore:
Timestamp:
01/16/2020 06:56:32 AM (7 years ago)
Author:
imath
Message:

Activity: fix some JS Coding standards for mentions script

Props passoniate

Fixes #8206

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/js/mentions.js

    r12516 r12522  
    8888                                 */
    8989                                before_reposition: function( offset ) {
    90                                         // get the iframe, if any, already applied with atwho
     90                                        // get the iframe, if any, already applied with atwho.
    9191                                        var caret,
    9292                                                        line,
     
    110110                                        }
    111111
    112                                         // If the caret is past horizontal half, then flip it, yo
     112                                        // If the caret is past horizontal half, then flip it, yo.
    113113                                        if ( caret.left > ( $body.width() / 2 ) ) {
    114114                                                $view.addClass( 'right' );
     
    119119                                        }
    120120
    121                                         // If we're on a small screen, scroll to caret
     121                                        // If we're on a small screen, scroll to caret.
    122122                                        if ( $body.width() <= 400 ) {
    123123                                                $( document ).scrollTop( caret.top - 6 );
    124124                                        }
    125125
    126                                         // New position is under the caret (never above) and positioned to follow
    127                                         // Dynamic sizing based on the input area (remove 'px' from end)
     126                                        // New position is under the caret (never above) and positioned to follow.
     127                                        // Dynamic sizing based on the input area (remove 'px' from end).
    128128                                        line = parseInt( this.$inputor.css( 'line-height' ).substr( 0, this.$inputor.css( 'line-height' ).length - 2 ), 10 );
    129                                         if ( !line || line < 5 ) { // sanity check, and catch no line-height
     129                                        if ( !line || line < 5 ) { // sanity check, and catch no line-height.
    130130                                                line = 19;
    131131                                        }
     
    139139                                 *
    140140                                 * @param {unknown} $inputor Element which we're inserting content into.
    141                                  * @param {string) content The content that will be inserted.
    142                                  * @param {string) suffix Applied to the end of the content string.
     141                                 * @param {string} content The content that will be inserted.
     142                                 * @param {string} suffix Applied to the end of the content string.
    143143                                 * @return {string}
    144144                                 * @since 2.1.0
Note: See TracChangeset for help on using the changeset viewer.