Comments: After [37743], prevent a JavaScript error when wpAjax.parseAjaxResponse()
returns an error or true.
Props rachelbaker. Fixes 36742. git-svn-id: https://develop.svn.wordpress.org/trunk@38050 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a9d1e10161
commit
c7ac50ab9e
@ -297,6 +297,15 @@ wpList = {
|
|||||||
res = wpAjax.parseAjaxResponse(r, s.response, s.element);
|
res = wpAjax.parseAjaxResponse(r, s.response, s.element);
|
||||||
rres = r;
|
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 ) {
|
if ( 'undefined' !== typeof res.responses[0].supplemental.comment_link ) {
|
||||||
var submittedOn = element.find( '.submitted-on' ),
|
var submittedOn = element.find( '.submitted-on' ),
|
||||||
commentLink = submittedOn.find( 'a' );
|
commentLink = submittedOn.find( 'a' );
|
||||||
@ -310,11 +319,6 @@ wpList = {
|
|||||||
submittedOn.text( commentLink.text() );
|
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) {
|
s.complete = function(x, st) {
|
||||||
|
Loading…
Reference in New Issue
Block a user