Add events to $.modalBox to capture "Escape" keypresses everywhere.

Review Request #13126 — Created June 26, 2023 and submitted

Information

Djblets
release-4.x

Reviewers

We have a handful of dialogs that use $.modalBox to create a modal on
the screen. In most cases, these have a "Close" or "Cancel" button, but
pressing the escape key wouldn't do anything. This change adds some
additional event handling to capture keypresses on the dialog itself as
well as the overlay and the base body element. This is then plumbed into
a "close" event triggered on the element, which the caller can handle to
perform whatever action necessary to close the dialog.

Used in conjuction with a change on the Review Board side.

Summary ID
Add events to $.modalBox to capture "Escape" keypresses everywhere.
We have a handful of dialogs that use $.modalBox to create a modal on the screen. In most cases, these have a "Close" or "Cancel" button, but pressing the escape key wouldn't do anything. This change adds some additional event handling to capture keypresses on the dialog itself as well as the overlay and the base body element. This is then plumbed into a "close" event triggered on the element, which the caller can handle to perform whatever action necessary to close the dialog. Testing Done: Used in conjuction with a change on the Review Board side.
cf66d89fe75bb5c0f42d6ded6c6a9bc344bfbc58
maubin
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.x (ea1b83d)