1
Fork 0

Hide theme button under menu in mobile mode and fix top margin issue (in mobile too)

This commit is contained in:
Guillaume Gomez 2018-02-08 23:47:49 +01:00
parent 932c736479
commit e9bcb4eb89
2 changed files with 7 additions and 32 deletions

View file

@ -123,25 +123,9 @@
sidebar.appendChild(div); sidebar.appendChild(div);
} }
} }
var themeChoices = document.getElementById("theme-choices"); var themePicker = document.getElementsByClassName("theme-picker");
if (themeChoices) { if (themePicker && themePicker.length > 0) {
if (!themesWidth) { themePicker[0].style.display = "none";
var savedState = themeChoices.style.display;
themeChoices.style.display = 'block';
themesWidth = themeChoices.offsetWidth + 'px';
themeChoices.style.display = savedState;
}
themeChoices.style.position = "fixed";
themeChoices.style.width = themesWidth;
themeChoices.style.top = '78px';
themeChoices.style.left = '250px';
}
document.getElementsByTagName("body")[0].style.marginTop = '45px';
var themePicker = document.getElementById("theme-picker");
if (themePicker) {
themePicker.style.position = "fixed";
themePicker.style.top = "50px";
themePicker.style.left = "250px";
} }
} }
@ -157,18 +141,9 @@
filler.remove(); filler.remove();
} }
document.getElementsByTagName("body")[0].style.marginTop = ''; document.getElementsByTagName("body")[0].style.marginTop = '';
var themePicker = document.getElementById("theme-picker"); var themePicker = document.getElementsByClassName("theme-picker");
if (themePicker) { if (themePicker && themePicker.length > 0) {
themePicker.style.position = "absolute"; themePicker[0].style.display = null;
themePicker.style.top = null;
themePicker.style.left = null;
}
var themeChoices = document.getElementById("theme-choices");
if (themeChoices) {
themeChoices.style.position = 'absolute';
themeChoices.style.width = null;
themeChoices.style.top = null;
themeChoices.style.left = null;
} }
} }

View file

@ -899,7 +899,7 @@ span.since {
} }
#main { #main {
margin-top: 50px; margin-top: 45px;
padding: 0; padding: 0;
} }