Skip to:
Content

BuddyPress.org

Changeset 3812


Ignore:
Timestamp:
01/22/2011 10:42:45 AM (14 years ago)
Author:
djpaul
Message:

Improve javascript class checks. Fixes #3013

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/_inc/global.js

    r3771 r3812  
    158158
    159159        /* Favoriting activity stream items */
    160         if ( target.attr('class') == 'fav' || target.attr('class') == 'unfav' ) {
     160        if ( target.hasClass('fav') || target.hasClass('unfav') ) {
    161161            var type = target.attr('class')
    162162            var parent = target.parent().parent().parent();
     
    239239
    240240        /* Load more updates at the end of the page */
    241         if ( target.parent().attr('class') == 'load-more' ) {
     241        if ( target.parent().hasClass('load-more') ) {
    242242            jq("#content li.load-more").addClass('loading');
    243243
     
    279279
    280280        /* Comment / comment reply links */
    281         if ( target.attr('class') == 'acomment-reply' || target.parent().attr('class') == 'acomment-reply' ) {
    282             if ( target.parent().attr('class') == 'acomment-reply' )
     281        if ( target.hasClass('acomment-reply') || target.parent().hasClass('acomment-reply') ) {
     282            if ( target.parent().hasClass('acomment-reply') )
    283283                target = target.parent();
    284284
     
    308308            }
    309309
    310             if ( form.parent().attr( 'class' ) == 'activity-comments' )
     310            if ( form.parent().hasClass( 'activity-comments' ) )
    311311                form.addClass('root');
    312312
     
    324324            var form_id = form.attr('id').split('-');
    325325
    326             if ( 'activity-comments' !== form_parent.attr('class') ) {
     326            if ( !form_parent.hasClass('activity-comments') ) {
    327327                var tmp_id = form_parent.attr('id').split('-');
    328328                var comment_id = tmp_id[1];
     
    356356                        function() {
    357357                            if ( 0 == form.parent().children('ul').length ) {
    358                                 if ( form.parent().attr('class') == 'activity-comments' )
     358                                if ( form.parent().hasClass('activity-comments') )
    359359                                    form.parent().prepend('<ul></ul>');
    360360                                else
     
    462462        if ( keyCode == 27 ) {
    463463            if (element.tagName == 'TEXTAREA') {
    464                 if ( jq(element).attr('class') == 'ac-input' )
     464                if ( jq(element).hasClass('ac-input') )
    465465                    jq(element).parent().parent().parent().slideUp( 200 );
    466466            }
Note: See TracChangeset for help on using the changeset viewer.