Changeset 6555
- Timestamp:
- 12/01/2012 02:02:39 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-templates/bp-legacy/js/buddypress.js
r6552 r6555 439 439 /* Check for errors and append if found. */ 440 440 if ( response[0] + response[1] == '-1' ) { 441 form.append( response.substr( 2, response.length ) ).fadeIn( 200);441 form.append( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) ); 442 442 } else { 443 443 form.fadeOut( 200, function() { … … 450 450 } 451 451 452 form.parent().children('ul').append( response).fadeIn( 200);452 form.parent().children('ul').append( jq( response ).hide().fadeIn( 200 ) ); 453 453 form.children('textarea').val(''); 454 454 form.parent().parent().addClass('has-comments'); … … 497 497 /* Check for errors and append if found. */ 498 498 if ( response[0] + response[1] == '-1' ) { 499 comment_li.prepend( response.substr( 2, response.length ) ).hide().fadeIn( 200);499 comment_li.prepend( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) ); 500 500 } else { 501 501 var children = jq( '#' + comment_li.attr('id') + ' ul' ).children('li'); … … 545 545 // Check for errors and append if found. 546 546 if ( response[0] + response[1] == '-1' ) { 547 comment_li.prepend( response.substr( 2, response.length ) ).hide().fadeIn( 200);547 comment_li.prepend( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) ); 548 548 549 549 } else { -
trunk/bp-themes/bp-default/_inc/global.js
r6553 r6555 430 430 } 431 431 432 jq.post( ajaxurl, ajaxdata, 433 function(response) 434 { 435 target.removeClass('loading'); 436 437 /* Check for errors and append if found. */ 438 if ( response[0] + response[1] == '-1' ) { 439 form.append( response.substr( 2, response.length ) ).fadeIn( 200 ); 440 } else { 441 form.fadeOut( 200, 442 function() { 443 if ( 0 == form.parent().children('ul').length ) { 444 if ( form.parent().hasClass('activity-comments') ) 445 form.parent().prepend('<ul></ul>'); 446 else 447 form.parent().append('<ul></ul>'); 448 } 449 450 form.parent().children('ul').append(response).fadeIn( 200 ); 451 form.children('textarea').val(''); 452 form.parent().parent().addClass('has-comments'); 432 jq.post( ajaxurl, ajaxdata, function(response) { 433 target.removeClass('loading'); 434 435 /* Check for errors and append if found. */ 436 if ( response[0] + response[1] == '-1' ) { 437 form.append( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) ); 438 } else { 439 form.fadeOut( 200, function() { 440 if ( 0 == form.parent().children('ul').length ) { 441 if ( form.parent().hasClass('activity-comments') ) { 442 form.parent().prepend('<ul></ul>'); 443 } else { 444 form.parent().append('<ul></ul>'); 453 445 } 454 ); 455 jq( 'form#' + form.attr('id') + ' textarea').val(''); 456 457 /* Increase the "Reply (X)" button count */ 458 jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html( Number( jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1 ); 459 } 460 461 jq(target).prop("disabled", false); 462 }); 446 } 447 448 form.parent().children('ul').append( jq( response ).hide().fadeIn( 200 ) ); 449 form.children('textarea').val(''); 450 form.parent().parent().addClass('has-comments'); 451 } ); 452 453 jq( 'form#' + form.attr('id') + ' textarea').val(''); 454 455 /* Increase the "Reply (X)" button count */ 456 jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html( Number( jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1 ); 457 } 458 459 jq(target).prop("disabled", false); 460 }); 463 461 464 462 return false; … … 496 494 /* Check for errors and append if found. */ 497 495 if ( response[0] + response[1] == '-1' ) { 498 comment_li.prepend( response.substr( 2, response.length ) ).fadeIn( 200);496 comment_li.prepend( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) ); 499 497 } else { 500 498 var children = jq( 'li#' + comment_li.attr('id') + ' ul' ).children('li'); … … 544 542 // Check for errors and append if found. 545 543 if ( response[0] + response[1] == '-1' ) { 546 comment_li.prepend( response.substr( 2, response.length ) ).fadeIn( 200);544 comment_li.prepend( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) ); 547 545 548 546 } else {
Note: See TracChangeset
for help on using the changeset viewer.