Skip to content

Commit 21afd28

Browse files
authored
Ensure that controls don't disappear in low resolution screens (#296)
1 parent 15d1d36 commit 21afd28

File tree

2 files changed

+44
-7
lines changed

2 files changed

+44
-7
lines changed

pages/getting-started/basic-tutorial.html

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -982,10 +982,10 @@ <h4>Delete Entity with ETag</h4>
982982
</div>
983983
<div class="col-1-12"></div>
984984
<div class="col-1-4" id="tutorial-contents">
985-
<nav class="tutorial-sidebar affix" aria-label="Page Contents">
985+
<nav class="tutorial-sidebar affix" aria-label="Page Contents" id="affix-navbar">
986986
<ul class="nav tutorial-sidenav">
987987
<li class="active">
988-
<a href="#requestData">Requesting Data</a></p>
988+
<p><a href="#requestData" class="sidenav-link">Requesting Data</a></p>
989989
<ul class="nav">
990990
<li><a href="#entitySet">Requesting Entity Collections</a></li>
991991
<li><a href="#entityByID">Requesting an Individual Entity by ID</a></li>
@@ -994,7 +994,7 @@ <h4>Delete Entity with ETag</h4>
994994
</ul>
995995
</li>
996996
<li>
997-
<a href="#queryData">Querying Data</a></p>
997+
<p><a href="#queryData" class="sidenav-link">Querying Data</a></p>
998998
<ul class="nav">
999999
<li><a href="#filter">System Query Option $filter</a></li>
10001000
<li><a href="#orderby">System Query Option $orderby</a></li>
@@ -1007,7 +1007,7 @@ <h4>Delete Entity with ETag</h4>
10071007
</ul>
10081008
</li>
10091009
<li>
1010-
<a href="#modifyData">Data Modification</a></p>
1010+
<p><a href="#modifyData" class="sidenav-link">Data Modification</a></p>
10111011
<ul class="nav">
10121012
<li><a href="#create">Create an Entity</a></li>
10131013
<li><a href="#delete">Delete an Entity</a></li>
@@ -1025,4 +1025,24 @@ <h4>Delete Entity with ETag</h4>
10251025
<!--/body-->
10261026
<script type="text/javascript">
10271027
$(".page-header").css({"width":"66.66%"});
1028+
const storeScroll = () => {
1029+
document.documentElement.dataset.scroll = window.scrollY;
1030+
var heightScrolled = window.scrollY;
1031+
var defaultHeight = 100;
1032+
if (heightScrolled < defaultHeight) {
1033+
$('#affix-navbar').removeClass("affix-top-30");
1034+
$('#affix-navbar').addClass("affix-top-50");
1035+
}
1036+
else{
1037+
$('#affix-navbar').removeClass("affix-top-50");
1038+
$('#affix-navbar').addClass("affix-top-30");
1039+
}
1040+
};
1041+
1042+
// Listen for new scroll events
1043+
document.addEventListener("scroll", storeScroll);
1044+
1045+
// Update scroll position for first time
1046+
storeScroll();
1047+
10281048
</script>

public/css/site.css

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,20 +134,26 @@ code {
134134
font-weight: 500;
135135
color: #bf3e11;
136136
padding: 4px 20px;
137+
word-wrap:break-word;
138+
overflow-wrap: break-word;
137139
}
138140
.tutorial-sidebar .nav>li>a:hover, .tutorial-sidebar .nav>li>a:focus {
139141
padding-left: 19px;
140142
color: #563d7c;
141143
text-decoration: none;
142144
background-color: transparent;
143145
border-left: 1px solid #563d7c;
146+
word-wrap:break-word;
147+
overflow-wrap: break-word;
144148
}
145149
.tutorial-sidebar .nav>.active>a, .tutorial-sidebar .nav>.active:hover>a, .tutorial-sidebar .nav>.active:focus>a {
146150
padding-left: 18px;
147151
font-weight: 700;
148152
color: #563d7c;
149153
background-color: transparent;
150154
border-left: 2px solid #563d7c;
155+
word-wrap:break-word;
156+
overflow-wrap: break-word;
151157
}
152158
.tutorial-sidebar .nav .nav {
153159
display: none;
@@ -159,6 +165,8 @@ code {
159165
padding-left: 30px;
160166
font-size: 14px;
161167
font-weight: 400;
168+
word-wrap:break-word;
169+
overflow-wrap: break-word;
162170
}
163171
.tutorial-sidebar .nav .nav>li>a:hover, .tutorial-sidebar .nav .nav>li>a:focus {
164172
padding-left: 29px;
@@ -168,7 +176,7 @@ code {
168176
padding-left: 28px;
169177
}
170178
.tutorial-sidebar.affix, .tutorial-sidebar.affix-bottom {
171-
width: 213px;
179+
word-wrap: break-word;
172180
}
173181
.tutorial-sidebar.affix {
174182
position: fixed;
@@ -190,7 +198,7 @@ code {
190198
top: 50px;
191199
}
192200

193-
@media (max-width: 991px) {
201+
@media (max-width: 767px) {
194202
.affix {
195203
position: static;
196204
display: block;
@@ -199,7 +207,7 @@ code {
199207
}
200208
}
201209

202-
@media (min-width:992px) {
210+
@media (min-width:768px) {
203211
.tutorial-sidebar .nav>.active>ul {
204212
display: block;
205213
}
@@ -359,9 +367,18 @@ pre {
359367
text-decoration: underline;
360368
}
361369

370+
.affix-top-50 {
371+
top: 50%;
372+
}
373+
374+
.affix-top-30 {
375+
top: 30%;
376+
}
377+
362378
@media screen and (-ms-high-contrast: active) {
363379
.tab-link {
364380
-ms-high-contrast-adjust:none;
365381
color: white;
366382
}
367383
}
384+

0 commit comments

Comments
 (0)