Skip to content

Commit e03caa9

Browse files
authored
Hide getting started sidebar on mobile (logicalclocks#46)
1 parent 3b94a52 commit e03caa9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/js/quickstart-fullscreen.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/*
2-
This script removes the sidebar from the Getting Started page for the example to expand whole page.
2+
This script removes the sidebar from the Getting Started page for the example to expand whole page on non-mobile devices.
33
*/
44

5-
if(window.location.pathname.endsWith('getting_started/quickstart/')) {
5+
//https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent for recommended approach to test if device is mobile
6+
if(window.location.pathname.endsWith('hopsworks-tutorials/quickstart/') && !/Mobi|Android/i.test(navigator.userAgent)) {
67
document.getElementsByClassName("md-sidebar--primary")[0].remove()
78
}

0 commit comments

Comments
 (0)