diff --git a/src/css/style.css b/src/css/style.css index 98e9c13e..333be7d9 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -391,6 +391,11 @@ header #back-button { max-height: 60vh; } +#attachment-preview button { + display: block; + margin-bottom: 10px; +} + #message-list { display: flex; max-width: 700px; diff --git a/src/js/app.js b/src/js/app.js index eaea50da..edc83e3b 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -327,27 +327,47 @@ if (!iris.util.isMobile) { }); } +$(document).keyup(function(e) { + if (e.key === "Escape") { // escape key maps to keycode `27` + closeAttachmentsPreview(); + } +}); + +function openAttachmentsPreview() { + var attachmentsPreview = $('#attachment-preview'); + attachmentsPreview.empty(); + var closeBtn = $('