Skip to:
Content

BuddyPress.org

Changeset 6635


Ignore:
Timestamp:
12/14/2012 12:10:51 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Swap out .live() calls for .on(). Props cnorris23. Antiprops jjj. Fixes #4714.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/js/widget-members.js

    r6264 r6635  
    11jQuery(document).ready( function() {
    2         jQuery(".widget div#members-list-options a").live('click',
     2        jQuery(".widget div#members-list-options a").on('click',
    33                function() {
    44                        var link = this;
  • trunk/bp-groups/js/widget-groups.js

    r6264 r6635  
    11jQuery(document).ready( function() {
    2         jQuery(".widget div#groups-list-options a").live('click',
     2        jQuery(".widget div#groups-list-options a").on('click',
    33                function() {
    44                        var link = this;
  • trunk/bp-templates/bp-legacy/js/buddypress.js

    r6629 r6635  
    3030                });
    3131                jq.scrollTo( jq('#whats-new'), 500, {
    32                         offset:-125, 
     32                        offset:-125,
    3333                        easing:'easeOutQuad'
    3434                } );
    … …  
    5050
    5151        /* New posts */
    52         jq("#aw-whats-new-submit").live( 'click', function() {
     52        jq("#aw-whats-new-submit").on( 'click', function() {
    5353                var button = jq(this);
    5454                var form = button.parent().parent().parent().parent();
    … …  
    141141
    142142        /* List tabs event delegation */
    143         jq('div.activity-type-tabs').live( 'click', function(event) {
     143        jq('div.activity-type-tabs').on( 'click', function(event) {
    144144                var target = jq(event.target).parent();
    145145
    … …  
    183183
    184184        /* Stream event delegation */
    185         jq('div.activity').live( 'click', function(event) {
     185        jq('div.activity').on( 'click', function(event) {
    186186                var target = jq(event.target);
    187187
    … …  
    323323
    324324        // Activity "Read More" links
    325         jq('.activity-read-more a').live('click', function(event) {
     325        jq('.activity-read-more a').on('click', function(event) {
    326326                var target = jq(event.target);
    327327                var link_id = target.parent().attr('id').split('-');
    … …  
    354354
    355355        /* Activity list event delegation */
    356         jq('div.activity').live( 'click', function(event) {
     356        jq('div.activity').on( 'click', function(event) {
    357357                var target = jq(event.target);
    358358
    … …  
    390390                        form.slideDown( 200 );
    391391                        jq.scrollTo( form, 500, {
    392                                 offset:-100, 
     392                                offset:-100,
    393393                                easing:'easeOutQuad'
    394394                        } );
    … …  
    410410                                var comment_id = form_id[2];
    411411                        }
    412                        
     412
    413413                        var content = jq( '#' + form.attr('id') + ' textarea' );
    414414
    … …  
    603603                }
    604604        });
    605        
     605
    606606        /* Link for cancelling comment forms */
    607         jq('.ac-reply-cancel').live( 'click', function() {
     607        jq('.ac-reply-cancel').on( 'click', function() {
    608608                jq(this).closest('.ac-form').slideUp( 200 );
    609609                return false;
    … …  
    613613
    614614        /* The search form on all directory pages */
    615         jq('.dir-search').live( 'click', function(event) {
     615        jq('.dir-search').on( 'click', function(event) {
    616616                if ( jq(this).hasClass('no-ajax') )
    617617                        return;
    … …  
    632632
    633633        /* When a navigation tab is clicked - e.g. | All Groups | My Groups | */
    634         jq('div.item-list-tabs').live( 'click', function(event) {
     634        jq('div.item-list-tabs').on( 'click', function(event) {
    635635                if ( jq(this).hasClass('no-ajax') )
    636636                        return;
    … …  
    680680
    681681        /* All pagination links run through this function */
    682         jq('#content').live( 'click', function(event) {
     682        jq('#content').on( 'click', function(event) {
    683683                var target = jq(event.target);
    684684
    … …  
    720720
    721721        /* Hit the "New Topic" button on the forums directory page */
    722         jq('a.show-hide-new').live( 'click', function() {
     722        jq('a.show-hide-new').on( 'click', function() {
    723723                if ( !jq('#new-topic-post').length )
    724724                        return false;
    … …  
    735735
    736736        /* Cancel the posting of a new forum topic */
    737         jq('#submit_topic_cancel').live( 'click', function() {
     737        jq('#submit_topic_cancel').on( 'click', function() {
    738738                if ( !jq('#new-topic-post').length )
    739739                        return false;
    … …  
    744744
    745745        /* Clicking a forum tag */
    746         jq('#forum-directory-tags a').live( 'click', function() {
     746        jq('#forum-directory-tags a').on( 'click', function() {
    747747                bp_filter_request( 'forums', 'tags', jq.cookie('bp-forums-scope'), 'div.forums', jq(this).html().replace( / /g, '-' ), 1, jq.cookie('bp-forums-extras') );
    748748                return false;
    … …  
    752752
    753753        /* Select a user from the list of friends and add them to the invite list */
    754         jq("#invite-list input").live( 'click', function() {
     754        jq("#invite-list input").on( 'click', function() {
    755755                jq('.ajax-loader').toggle();
    756756
    … …  
    790790
    791791        /* Remove a user from the list of users to invite to a group */
    792         jq("#friend-list li a.remove").live('click', function() {
     792        jq("#friend-list li a.remove").on('click', function() {
    793793                jq('.ajax-loader').toggle();
    794794
    … …  
    819819        jq('.visibility-toggle-link').on( 'click', function() {
    820820                var toggle_div = jq(this).parent();
    821                
     821
    822822                jq(toggle_div).fadeOut( 600, function(){
    823823                        jq(toggle_div).siblings('.field-visibility-settings').slideDown(400);
    824824                });
    825                
     825
    826826                return false;
    827827        } );
    … …  
    829829        jq('.field-visibility-settings-close').on( 'click', function() {
    830830                var settings_div = jq(this).parent();
    831                
     831
    832832                jq(settings_div).slideUp( 400, function(){
    833833                        jq(settings_div).siblings('.field-visibility-settings-toggle').fadeIn(800);
    834834                });
    835                
     835
    836836                return false;
    837837        } );
    … …  
    841841
    842842        /* Accept and Reject friendship request buttons */
    843         jq("#friend-list a.accept, #friend-list a.reject").live( 'click', function() {
     843        jq("#friend-list a.accept, #friend-list a.reject").on( 'click', function() {
    844844                var button = jq(this);
    845845                var li = jq(this).parents('#friend-list li');
    … …  
    896896
    897897        /* Add / Remove friendship buttons */
    898         jq(".friendship-button a").live('click', function() {
     898        jq(".friendship-button a").on('click', function() {
    899899                jq(this).parent().addClass('loading');
    900900                var fid = jq(this).attr('id');
    … …  
    946946        /** Group Join / Leave Buttons **************************************/
    947947
    948         jq(".group-button a").live('click', function() {
     948        jq(".group-button a").on('click', function() {
    949949                var gid = jq(this).parent().attr('id');
    950950                gid = gid.split('-');
    … …  
    990990
    991991        /** Message search*/
    992         jq('.message-search').live( 'click', function(event) {
     992        jq('.message-search').on( 'click', function(event) {
    993993                if ( jq(this).hasClass('no-ajax') )
    994994                        return;
    … …  
    11301130
    11311131        /* Bulk delete messages */
    1132         jq("#delete_inbox_messages, #delete_sentbox_messages").live( 'click', function() {
     1132        jq("#delete_inbox_messages, #delete_sentbox_messages").on( 'click', function() {
    11331133                checkboxes_tosend = '';
    11341134                checkboxes = jq("#message-threads tr td input[type='checkbox']");
    … …  
    11691169
    11701170        /* Close site wide notices in the sidebar */
    1171         jq("#close-notice").live( 'click', function() {
     1171        jq("#close-notice").on( 'click', function() {
    11721172                jq(this).addClass('loading');
    11731173                jq('#sidebar div.error').remove();
    … …  
    12001200
    12011201        /* Clear BP cookies on logout */
    1202         jq('a.logout').live( 'click', function() {
     1202        jq('a.logout').on( 'click', function() {
    12031203                jq.cookie('bp-activity-scope', null, {
    12041204                        path: '/'
  • trunk/bp-themes/bp-default/_inc/global.js

    r6555 r6635  
    3030                });
    3131                jq.scrollTo( jq('textarea#whats-new'), 500, {
    32                         offset:-125, 
     32                        offset:-125,
    3333                        easing:'easeOutQuad'
    3434                } );
    … …  
    323323
    324324        // Activity "Read More" links
    325         jq('.activity-read-more a').live('click', function(event) {
     325        jq('.activity-read-more a').on('click', function(event) {
    326326                var target = jq(event.target);
    327327                var link_id = target.parent().attr('id').split('-');
    … …  
    390390                        form.slideDown( 200 );
    391391                        jq.scrollTo( form, 500, {
    392                                 offset:-100, 
     392                                offset:-100,
    393393                                easing:'easeOutQuad'
    394394                        } );
    … …  
    781781
    782782        /* Remove a user from the list of users to invite to a group */
    783         jq("#friend-list li a.remove").live('click', function() {
     783        jq("#friend-list li a.remove").on('click', function() {
    784784                jq('.ajax-loader').toggle();
    785785
    … …  
    810810        jq('.visibility-toggle-link').on( 'click', function() {
    811811                var toggle_div = jq(this).parent();
    812                
     812
    813813                jq(toggle_div).fadeOut( 600, function(){
    814814                        jq(toggle_div).siblings('.field-visibility-settings').slideDown(400);
    815815                });
    816                
     816
    817817                return false;
    818818        } );
    … …  
    820820        jq('.field-visibility-settings-close').on( 'click', function() {
    821821                var settings_div = jq(this).parent();
    822                
     822
    823823                jq(settings_div).slideUp( 400, function(){
    824824                        jq(settings_div).siblings('.field-visibility-settings-toggle').fadeIn(800);
    825825                });
    826                
     826
    827827                return false;
    828828        } );
    … …  
    887887
    888888        /* Add / Remove friendship buttons */
    889         jq(".friendship-button a").live('click', function() {
     889        jq(".friendship-button a").on('click', function() {
    890890                jq(this).parent().addClass('loading');
    891891                var fid = jq(this).attr('id');
    … …  
    937937        /** Group Join / Leave Buttons **************************************/
    938938
    939         jq(".group-button a").live('click', function() {
     939        jq(".group-button a").on('click', function() {
    940940                var gid = jq(this).parent().attr('id');
    941941                gid = gid.split('-');
  • trunk/bp-xprofile/admin/js/admin.js

    r6630 r6635  
    1212        newDiv.setAttribute('id', forWhat + '_div' + theId);
    1313        newDiv.setAttribute('class', 'sortable');
    14        
     14
    1515        newOption.setAttribute( 'type', 'text' );
    1616        newOption.setAttribute( 'name', forWhat + '_option[' + theId + ']' );
    … …  
    108108
    109109        // Set up deleting options ajax
    110         jQuery( 'a.ajax-option-delete' ).live( 'click', function() {
     110        jQuery( 'a.ajax-option-delete' ).on( 'click', function() {
    111111                var theId = this.id.split( '-' );
    112112                theId = theId[1];
    … …  
    121121        } );
    122122
    123         // 
     123        //
    124124        jQuery( '[id^="sort_order_"]' ).change(function() {
    125125                if ( jQuery( this ).val() != 'custom' ) {
Note: See TracChangeset for help on using the changeset viewer.