Skip to content

Commit

Permalink
Fix mobile view
Browse files Browse the repository at this point in the history
  • Loading branch information
deltakosh committed Mar 23, 2018
1 parent 9614d7f commit 2f347ca
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion public/html/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
html: '<i class="fa fa-book"></i>Samples'
}),
$('<a>', {
href: '/classes',
href: '/api.html',
html: '<i class="fa fa-files-o"></i>Classes'
}),
$('<a>', {
Expand Down
46 changes: 24 additions & 22 deletions views/classes.pug
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
include includes/header.pug
include includes/banner.pug
script.
function resizeIframe(obj) {
obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
document.body.scrollIntoView();
var target;
if (obj.contentWindow.location.href.indexOf("/classes/classes/babylon.") !== -1) {
target = obj.contentWindow.location.href.replace(".html", "").replace("/classes/classes/babylon.", "/api.html?");
} else {
target = obj.contentWindow.location.href.replace("/classes/globals.html", "/api.html");
}
#wrapper
script.
function resizeIframe(obj) {
obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
document.body.scrollIntoView();
var target;
if (obj.contentWindow.location.href.indexOf("/classes/classes/babylon.") !== -1) {
target = obj.contentWindow.location.href.replace(".html", "").replace("/classes/classes/babylon.", "/api.html?");
} else {
target = obj.contentWindow.location.href.replace("/classes/globals.html", "/api.html");
}

if (target && location.href !== target) {
// Faking the URL
window.history.replaceState({state:""}, "Babylon.js Documentation", target);
if (target && location.href !== target) {
// Faking the URL
window.history.replaceState({state:""}, "Babylon.js Documentation", target);
}
}
}
iframe(id="iframe", width='100%', scrolling='no', frameborder='no', src="/classes/globals.html" onload="resizeIframe(this)")
script.
(function deepLink() {
var iframe = document.getElementById("iframe");
iframe(id="iframe", width='100%', scrolling='no', frameborder='no', src="/classes/globals.html" onload="resizeIframe(this)")
script.
(function deepLink() {
var iframe = document.getElementById("iframe");

if (location.search) {
iframe.src = "/classes/classes/babylon." + location.search.replace("babylon", "").replace("?", "") + ".html";
}
})()
if (location.search) {
iframe.src = "/classes/classes/babylon." + location.search.replace("babylon", "").replace("?", "") + ".html";
}
})()
include includes/footer.pug
2 changes: 1 addition & 1 deletion views/errorpages/404_class_not_found.pug
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ include ../includes/header
i.fa.fa-arrow-circle-left
| You can go back to the previous page...
.error_choice
a(href="/classes")
a(href="/api.html")
| ... or you can browse all classes
i.fa.fa-arrow-circle-right

Expand Down
4 changes: 0 additions & 4 deletions views/includes/banner.pug
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
nav.nav-main(style={position: 'inherit'})
// Hamburger menu : displayed only in small screens
i#mobilemenu.fa.fa-bars
// this button only shows on mobile version of a "class" page
if currentUrl === '/classes/class'
a(href='/classes/' + currentVersion)
i#goBackToClassList.fa.fa-arrow-left

.banner
.menu
Expand Down

0 comments on commit 2f347ca

Please sign in to comment.