Comments: After [37743], prevent a JavaScript error when `wpAjax.parseAjaxResponse()` returns an error or true.

Props rachelbaker.
Fixes 36742.
Built from https://develop.svn.wordpress.org/trunk@38050


git-svn-id: http://core.svn.wordpress.org/trunk@37991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2016-07-13 15:03:28 +00:00
parent 349de667fa
commit 456c9bea3d
3 changed files with 11 additions and 7 deletions

View File

@ -297,6 +297,15 @@ wpList = {
res = wpAjax.parseAjaxResponse(r, s.response, s.element);
rres = r;
if ( true === res ) {
return true;
}
if ( ! res || res.errors ) {
element.stop().stop().css( 'backgroundColor', '#FF3333' )[isClass?'removeClass':'addClass'](s.dimClass).show().queue( function() { list.wpList.recolor(); $(this).dequeue(); } );
return false;
}
if ( 'undefined' !== typeof res.responses[0].supplemental.comment_link ) {
var submittedOn = element.find( '.submitted-on' ),
commentLink = submittedOn.find( 'a' );
@ -310,11 +319,6 @@ wpList = {
submittedOn.text( commentLink.text() );
}
}
if ( !res || res.errors ) {
element.stop().stop().css( 'backgroundColor', '#FF3333' )[isClass?'removeClass':'addClass'](s.dimClass).show().queue( function() { list.wpList.recolor(); $(this).dequeue(); } );
return false;
}
};
s.complete = function(x, st) {

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-beta2-38049';
$wp_version = '4.6-beta2-38050';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.