From 19dacca2e2b755f147597c6fc224b1c806370e92 Mon Sep 17 00:00:00 2001 From: "tinajohnson.1234" Date: Thu, 3 Apr 2014 19:16:00 +0530 Subject: [PATCH] Added keyboard shortcut (ESC key) to close notifications flyout Notifications flyout is closed when ESC key is pressed. Bug: 53588 Change-Id: I220affcc383c943ca9d977bc4014d45904ce06c2 --- modules/overlay/ext.echo.overlay.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/overlay/ext.echo.overlay.js b/modules/overlay/ext.echo.overlay.js index d29ca328d..1fa4f77b2 100644 --- a/modules/overlay/ext.echo.overlay.js +++ b/modules/overlay/ext.echo.overlay.js @@ -337,5 +337,13 @@ mw.echo.overlay.removeOverlay(); } } ); + + // Closes the notifications overlay when ESC key pressed + $( document ).on( 'keydown', function ( e ) { + if ( e.which === 27 ) { + mw.echo.overlay.removeOverlay(); + } + } ); + } ); } )( jQuery, mediaWiki );