Make WordPress Core

Ticket #25627: edit-comments.js.diff

File edit-comments.js.diff, 1.1 KB (added by mt8.biz, 10 years ago)
  • src/wp-admin/js/edit-comments.js

     
    283283                        var wpListsData = $(s.target).attr('data-wp-lists'), id = s.element.replace(/[^0-9]+/g, '');
    284284
    285285                        if ( wpListsData.indexOf(':trash=1') != -1 || wpListsData.indexOf(':spam=1') != -1 )
    286                                 $('#undo-' + id).fadeIn(300, function(){ $(this).show() });
     286                                $('#undo-' + id).fadeIn(300, function(){
     287                                        $(this).show()
     288                                        commentReply.doing_action = false;
     289                                });
    287290                });
    288291};
    289292
     
    290293commentReply = {
    291294        cid : '',
    292295        act : '',
     296        doing_action : false,
    293297
    294298        init : function() {
    295299                var row = $('#replyrow');
     
    313317                        if ( $('#the-comment-list #replyrow').length > 0 )
    314318                                commentReply.close();
    315319                });
     320               
     321                $('.spam a, .trash a','.row-actions').click(function(){                 
     322                        if (commentReply.doing_action){
     323                                return false;
     324                        }else{
     325                                commentReply.doing_action = true;
     326                                return true;
     327                        }
     328                });
    316329
    317330                this.comments_listing = $('#comments-form > input[name="comment_status"]').val() || '';
    318331