From 95ae0607d5547552e6ca4374394de91b3fe188ad Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 7 Apr 2019 01:15:05 +0200 Subject: [PATCH] Avoid having to click two times on the tile to show the portal --- portal/assets/js/ynh_portal.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/portal/assets/js/ynh_portal.js b/portal/assets/js/ynh_portal.js index ae6322f..6f77802 100644 --- a/portal/assets/js/ynh_portal.js +++ b/portal/assets/js/ynh_portal.js @@ -264,6 +264,7 @@ function init_portal_button_and_overlay() portalOverlay.setAttribute("id","ynh-overlay"); portalOverlay.setAttribute("style","visibility: hidden;"); // make sure the overlay is invisible already when loading it document.body.insertBefore(portalOverlay, null); + Element.addClass(portalOverlay, 'ynh-fadeOut'); // Inject portal button var portalButton = document.createElement('a'); @@ -279,8 +280,6 @@ function init_portal_button_and_overlay() // Prevent default click window.eventPreventDefault(e); // Toggle overlay on YNHPortal button click - Element.toggleClass(portalOverlay, 'visible'); - Element.toggleClass(portalButton, 'visible'); Element.toggleClass(document.querySelector('html'), 'ynh-panel-active'); Element.toggleClass(portalOverlay, 'ynh-active');