Make WordPress Core

Changeset 38050


Ignore:
Timestamp:
07/13/2016 03:02:59 PM (9 years ago)
Author:
ocean90
Message:

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

Props rachelbaker.
Fixes 36742.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/wp-lists.js

    r37743 r38050  
    298298            rres = r;
    299299
     300            if ( true === res ) {
     301                return true;
     302            }
     303
     304            if ( ! res || res.errors ) {
     305                element.stop().stop().css( 'backgroundColor', '#FF3333' )[isClass?'removeClass':'addClass'](s.dimClass).show().queue( function() { list.wpList.recolor(); $(this).dequeue(); } );
     306                return false;
     307            }
     308
    300309            if ( 'undefined' !== typeof res.responses[0].supplemental.comment_link ) {
    301310                var submittedOn = element.find( '.submitted-on' ),
     
    310319                    submittedOn.text( commentLink.text() );
    311320                }
    312             }
    313 
    314             if ( !res || res.errors ) {
    315                 element.stop().stop().css( 'backgroundColor', '#FF3333' )[isClass?'removeClass':'addClass'](s.dimClass).show().queue( function() { list.wpList.recolor(); $(this).dequeue(); } );
    316                 return false;
    317321            }
    318322        };
Note: See TracChangeset for help on using the changeset viewer.