Ticket #54548: 54548.3.diff
File 54548.3.diff, 1.1 KB (added by , 3 years ago) |
---|
-
src/js/_enqueues/admin/edit-comments.js
1019 1019 } 1020 1020 1021 1021 setTimeout(function() { 1022 var rtop, rbottom, scrollTop, vp, scrollBottom; 1022 var rtop, rbottom, scrollTop, vp, scrollBottom, 1023 isComposing = false; 1023 1024 1024 1025 rtop = $('#replyrow').offset().top; 1025 1026 rbottom = rtop + $('#replyrow').height(); … … 1032 1033 else if ( rtop - 20 < scrollTop ) 1033 1034 window.scroll(0, rtop - 35); 1034 1035 1035 $('#replycontent').trigger( 'focus' ).on( 'keyup', function(e){ 1036 if ( e.which == 27 ) 1037 commentReply.revert(); // Close on Escape. 1038 }); 1036 $( '#replycontent' ) 1037 .trigger( 'focus' ) 1038 .on( 'keyup', function( e ) { 1039 // Close on Escape except when Input Method Editors (IMEs) are in use. 1040 if ( e.which === 27 && ! isComposing ) { 1041 commentReply.revert(); 1042 } 1043 } ) 1044 .on( 'compositionstart', function() { 1045 isComposing = true; 1046 } ); 1039 1047 }, 600); 1040 1048 1041 1049 return false;