Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Misc bug-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
christianwach committed Apr 11, 2012
1 parent cca3da2 commit 8d4a8e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions cp-ajax-comments.dev.js
Expand Up @@ -583,6 +583,10 @@ jQuery(document).ready(function($) {
*/
function cpac_nice_append( response, content, target, last ) {

// test for undefined, which may happen on replies to comments
// which have lost their original context
if ( response === undefined || response === null ) { return; }

response.find(content)
.hide()
.appendTo(target);
Expand All @@ -604,6 +608,10 @@ jQuery(document).ready(function($) {
*/
function cpac_nice_prepend( response, content, target, last ) {

// test for undefined, which may happen on replies to comments
// which have lost their original context
if ( response === undefined || response === null ) { return; }

response.find(content)
.hide()
.prependTo(target);
Expand Down Expand Up @@ -829,6 +837,7 @@ jQuery(document).ready(function($) {

// get our data as object
var response = jQuery(data);
//console.log( data );

// add comment
cpac_add_comment( response );
Expand Down
6 changes: 3 additions & 3 deletions cp-ajax-comments.php
Expand Up @@ -78,7 +78,7 @@ function cpac_enable_plugin() {
// kick out if...

// cp is not enabled
if ( !is_object( $commentpress_obj ) ) { return; }
if ( is_null( $commentpress_obj ) OR !is_object( $commentpress_obj ) ) { return; }

// we're in the WP back end
if ( is_admin() ) { return; }
Expand All @@ -89,7 +89,7 @@ function cpac_enable_plugin() {
add_action('wp_head', 'cpac_localise');

// add our javascripts
add_action('wp_print_scripts', 'cpac_add_javascripts', 20);
add_action('wp_enqueue_scripts', 'cpac_add_javascripts', 20);

}

Expand Down Expand Up @@ -319,7 +319,7 @@ function cpac_add_javascripts() {
$debug_state = '';

// target different scripts when debugging
if ( defined( 'WP_DEBUG' ) AND WP_DEBUG === true ) {
if ( defined( 'SCRIPT_DEBUG' ) AND SCRIPT_DEBUG === true ) {

// use uncompressed scripts
$debug_state = '.dev';
Expand Down

0 comments on commit 8d4a8e4

Please sign in to comment.