From 67da82c151a5747207c67c1fd4250b52cf6cdf69 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sat, 9 Sep 2017 13:22:49 +0300 Subject: [PATCH] Fix image viewer turning black sometimes --- client/js/renderPreview.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/js/renderPreview.js b/client/js/renderPreview.js index 14edb400..6ece1b9d 100644 --- a/client/js/renderPreview.js +++ b/client/js/renderPreview.js @@ -161,7 +161,11 @@ function openImageViewer(link) { hasNextImage: nextImage.length > 0, })); - imageViewer.addClass("opened"); + // Turn off transitionend listener before opening the viewer, + // which caused image viewer to become empty in rare cases + imageViewer + .off("transitionend") + .addClass("opened"); } imageViewer.on("click", ".previous-image-btn", function() {