From 058cfb0ac70e9bb2e692709121e4f8a5acaeda08 Mon Sep 17 00:00:00 2001 From: Martti Malmi Date: Tue, 19 May 2020 10:05:17 +0300 Subject: [PATCH] animate gallery --- src/js/app.js | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/src/js/app.js b/src/js/app.js index 45651540..f1d04b8b 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -338,13 +338,18 @@ if (!iris.util.isMobile) { $(document).keyup(function(e) { if (e.key === "Escape") { // escape key maps to keycode `27` + if ($('#attachment-preview.gallery:visible').length) { + closeAttachmentsGallery(); + } else { closeAttachmentsPreview(); } + } }); function openAttachmentsPreview() { $('#floating-day-separator').remove(); var attachmentsPreview = $('#attachment-preview'); + attachmentsPreview.removeClass('gallery'); attachmentsPreview.empty(); var closeBtn = $('