Fix rendering issues on mobile
This commit is contained in:
parent
56733bc9f8
commit
dde3611281
3 changed files with 32 additions and 4 deletions
|
@ -47,6 +47,8 @@
|
|||
// 2 for "In Return Types"
|
||||
var currentTab = 0;
|
||||
|
||||
var themesWidth = null;
|
||||
|
||||
function hasClass(elem, className) {
|
||||
if (elem && className && elem.className) {
|
||||
var elemClass = elem.className;
|
||||
|
@ -121,10 +123,25 @@
|
|||
sidebar.appendChild(div);
|
||||
}
|
||||
}
|
||||
var themeChoices = document.getElementById("theme-choices");
|
||||
if (themeChoices) {
|
||||
if (!themesWidth) {
|
||||
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";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -143,6 +160,15 @@
|
|||
var themePicker = document.getElementById("theme-picker");
|
||||
if (themePicker) {
|
||||
themePicker.style.position = "absolute";
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue