Changeset 59514
- Timestamp:
- 12/14/2024 01:30:07 AM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/edit-comments.js
r58931 r59514 1021 1021 setTimeout(function() { 1022 1022 var rtop, rbottom, scrollTop, vp, scrollBottom, 1023 isComposing = false; 1023 isComposing = false, 1024 isContextMenuOpen = false; 1024 1025 1025 1026 rtop = $('#replyrow').offset().top; … … 1036 1037 $( '#replycontent' ) 1037 1038 .trigger( 'focus' ) 1039 .on( 'contextmenu keydown', function ( e ) { 1040 // Check if the context menu is open and set state. 1041 if ( e.type === 'contextmenu' ) { 1042 isContextMenuOpen = true; 1043 } 1044 1045 // Update the context menu state if the Escape key is pressed. 1046 if ( e.type === 'keydown' && e.which === 27 && isContextMenuOpen ) { 1047 isContextMenuOpen = false; 1048 } 1049 } ) 1038 1050 .on( 'keyup', function( e ) { 1039 // Close on Escape except when Input Method Editors (IMEs) are in use.1040 if ( e.which === 27 && ! isComposing ) {1051 // Close on Escape unless Input Method Editors (IMEs) are in use or the context menu is open. 1052 if ( e.which === 27 && ! isComposing && ! isContextMenuOpen ) { 1041 1053 commentReply.revert(); 1042 1054 }
Note: See TracChangeset
for help on using the changeset viewer.