[enh] More responsive, and CSS cleanup.

This commit is contained in:
opi 2014-05-20 13:15:12 +02:00
parent 9f020a1cb9
commit 2622629d0a
2 changed files with 981 additions and 92 deletions

File diff suppressed because one or more lines are too long

View file

@ -122,6 +122,17 @@ domReady(function(){
// Don't do this in iframe // Don't do this in iframe
if (window.self !== window.top) {return false;} if (window.self !== window.top) {return false;}
// Set and store meta viewport
var meta_viewport = document.querySelector('meta[name="viewport"]');
if (meta_viewport === null) {
meta_viewport = document.createElement('meta');
meta_viewport.setAttribute('name', "viewport");
meta_viewport.setAttribute('content', "");
document.getElementsByTagName('head')[0].insertBefore(meta_viewport, null);
}
meta_viewport = document.querySelector('meta[name="viewport"]');
meta_viewport_content = meta_viewport.getAttribute('content');
// Add portal stylesheet // Add portal stylesheet
var portalStyle = document.createElement("link"); var portalStyle = document.createElement("link");
portalStyle.setAttribute("rel", "stylesheet"); portalStyle.setAttribute("rel", "stylesheet");
@ -154,7 +165,6 @@ domReady(function(){
if (r.readyState != 4 || r.status != 200) return; if (r.readyState != 4 || r.status != 200) return;
// Response is JSON // Response is JSON
document.querySelector('body').classList.add('ynh-panel-active');
response = JSON.parse(r.responseText); response = JSON.parse(r.responseText);
// Add overlay header // Add overlay header
@ -196,8 +206,11 @@ domReady(function(){
// Toggle overlay on YNHPortal button // Toggle overlay on YNHPortal button
//Element.toggleClass(overlay, 'visible'); //Element.toggleClass(overlay, 'visible');
Element.toggleClass(portal, 'visible'); Element.toggleClass(portal, 'visible');
Element.toggleClass(document.querySelector('html'), 'ynh-panel-active');
if(yunoverlay.classList.contains('yuno-active')) { if(yunoverlay.classList.contains('yuno-active')) {
meta_viewport.setAttribute('content', meta_viewport_content);
yunoverlay.classList.add('yuno-fadeOut'); yunoverlay.classList.add('yuno-fadeOut');
PrefixedEvent(yunoverlay, "AnimationEnd", function(){ PrefixedEvent(yunoverlay, "AnimationEnd", function(){
if(yunoverlay.classList.contains('yuno-fadeOut')) { if(yunoverlay.classList.contains('yuno-fadeOut')) {
@ -208,6 +221,7 @@ domReady(function(){
apps.classList.remove('yuno-fadeInLeft', 'yuno-delay'); apps.classList.remove('yuno-fadeInLeft', 'yuno-delay');
user.classList.remove('yuno-slideintop'); user.classList.remove('yuno-slideintop');
}else { }else {
meta_viewport.setAttribute('content', "width=device-width");
yunoverlay.classList.remove('yuno-fadeOut'); yunoverlay.classList.remove('yuno-fadeOut');
yunoverlay.classList.add('yuno-active'); yunoverlay.classList.add('yuno-active');