Merge pull request #186 from andretheolauret/fix-1491-ios_overlay_appear_desappear

[Fix] Yunohost Overlay - Appear/Desappear bug
This commit is contained in:
Alexandre Aubin 2021-08-08 19:49:16 +02:00 committed by GitHub
commit c8631c2fa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View file

@ -20,9 +20,12 @@
html.ynh-panel-active { html.ynh-panel-active {
/* Disable any scrolling on app */ /* Disable any scrolling on app */
overflow: hidden; overflow: hidden;
} }
body {/*overflow-y: scroll;*/} body {
overflow-y: auto;
}
#ynh-overlay-switch, #ynh-overlay-switch,
#ynh-overlay-switch *, #ynh-overlay-switch *,
@ -70,14 +73,14 @@ body {/*overflow-y: scroll;*/}
/* Background */ /* Background */
#ynh-overlay { #ynh-overlay {
visibility: hidden; overflow-y: hidden;
position: fixed; position: fixed;
top:0; top:0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
z-index: 9999999; z-index: 9999999;
display: block; display: none;
border: none; border: none;
color:#fff; color:#fff;
background: #41444F; background: #41444F;
@ -176,4 +179,4 @@ body {/*overflow-y: scroll;*/}
width: 80px; width: 80px;
height: 75px; height: 75px;
} }
} }

View file

@ -265,7 +265,8 @@ function init_portal_button_and_overlay()
var portalOverlay = document.createElement('iframe'); var portalOverlay = document.createElement('iframe');
portalOverlay.src = "/yunohost/sso/portal.html"; portalOverlay.src = "/yunohost/sso/portal.html";
portalOverlay.setAttribute("id","ynh-overlay"); portalOverlay.setAttribute("id","ynh-overlay");
portalOverlay.setAttribute("style","visibility: hidden;"); // make sure the overlay is invisible already when loading it portalOverlay.setAttribute("style","display: none;"); // make sure the overlay is invisible already when loading it
// portalOverlay.setAttribute("class","ynh-fadeOut"); // set overlay as masked when loading it
document.body.insertBefore(portalOverlay, null); document.body.insertBefore(portalOverlay, null);
// Inject portal button // Inject portal button
@ -286,10 +287,12 @@ function init_portal_button_and_overlay()
Element.toggleClass(portalOverlay, 'ynh-active'); Element.toggleClass(portalOverlay, 'ynh-active');
if (Element.hasClass(portalOverlay, 'ynh-active')) { if (Element.hasClass(portalOverlay, 'ynh-active')) {
portalOverlay.setAttribute("style","display: block;");
meta_viewport.setAttribute('content', meta_viewport_content); meta_viewport.setAttribute('content', meta_viewport_content);
Element.addClass(portalOverlay, 'ynh-fadeIn'); Element.addClass(portalOverlay, 'ynh-fadeIn');
Element.removeClass(portalOverlay, 'ynh-fadeOut'); Element.removeClass(portalOverlay, 'ynh-fadeOut');
} else { } else {
portalOverlay.setAttribute("style","display: none;");
meta_viewport.setAttribute('content', "width=device-width"); meta_viewport.setAttribute('content', "width=device-width");
Element.removeClass(portalOverlay, 'ynh-fadeIn'); Element.removeClass(portalOverlay, 'ynh-fadeIn');
Element.addClass(portalOverlay, 'ynh-fadeOut'); Element.addClass(portalOverlay, 'ynh-fadeOut');
@ -341,6 +344,7 @@ function init_portal()
}); });
} }
function tweak_portal_when_in_iframe() function tweak_portal_when_in_iframe()
{ {
// Set class to body to show we're in overlay // Set class to body to show we're in overlay
@ -369,4 +373,4 @@ function tweak_portal_when_in_iframe()
window.parent.location.href = logoutButton.getAttribute("href"); window.parent.location.href = logoutButton.getAttribute("href");
}); });
} }
} }