Make WordPress Core

Changeset 32857


Ignore:
Timestamp:
06/19/2015 01:47:35 PM (9 years ago)
Author:
obenland
Message:

Check that current changes can be lost before editing another comment.

When replying to or editing a comment, double-clicking another comment will
open it in quick edit and changes to the current comment are lost.

Props pareshradadiya, chriscct7.
Fixes #21845.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/edit-comments.js

    r32495 r32857  
    314314
    315315    toggle : function(el) {
    316         if ( $(el).css('display') != 'none' )
    317             $(el).find('a.vim-q').click();
     316        if ( 'none' !== $( el ).css( 'display' ) && ( $( '#replyrow' ).parent().is('#com-reply') || window.confirm( adminCommentsL10n.warnQuickEdit ) ) ) {
     317            $( el ).find( 'a.vim-q' ).click();
     318        }
    318319    },
    319320
  • trunk/src/wp-includes/script-loader.php

    r32856 r32857  
    440440            'hotkeys_highlight_last' => isset($_GET['hotkeys_highlight_last']),
    441441            'replyApprove' => __( 'Approve and Reply' ),
    442             'reply' => __( 'Reply' )
     442            'reply' => __( 'Reply' ),
     443            'warnQuickEdit' => __( "Are you sure you want to edit this comment?\nThe changes you made will be lost." ),
    443444        ) );
    444445
Note: See TracChangeset for help on using the changeset viewer.