Make WordPress Core

Changeset 29481


Ignore:
Timestamp:
08/13/2014 06:14:15 PM (11 years ago)
Author:
wonderboymusic
Message:

In the Edit Attachment frame, when in Edit Image mode, add a key event for Escape. There are conflicting keydown handlers that don't propagate the event to the modal properly.

Fixes #29121.

File:
1 edited

Legend:

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

    r29444 r29481  
    493493                return event;
    494494            }
     495
     496            // Escape key, while in the Edit Image mode
     497            if ( 27 === event.keyCode ) {
     498                this.modal.close();
     499            }
     500
    495501            // The right arrow key
    496             if ( event.keyCode === 39 ) {
     502            if ( 39 === event.keyCode ) {
    497503                this.nextMediaItem();
    498504            }
    499505            // The left arrow key
    500             if ( event.keyCode === 37 ) {
     506            if ( 37 === event.keyCode ) {
    501507                this.previousMediaItem();
    502508            }
Note: See TracChangeset for help on using the changeset viewer.