Skip to content

Commit d937448

Browse files
docs: show version switcher at tob in mobile
1 parent c6a4ccd commit d937448

File tree

3 files changed

+70
-7
lines changed

3 files changed

+70
-7
lines changed

docs/site/components/subpage/subpage-directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ angular
2222
if ($scope.versionSelected === 'master') {
2323
$http.get('https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/commits?sha=gh-pages&per_page=1')
2424
.then(function(resp) {
25-
$scope.lastBuiltDate = moment(resp.data[0].commit.committer.date).format('MMMM Do, YYYY');
25+
$scope.lastBuiltDate = moment(resp.data[0].commit.committer.date);
2626
});
2727
}
2828

docs/site/components/subpage/subpage.html

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,26 @@ <h1 class="logo">
2121
<header ng-if="headerTemplateUrl" ng-include="headerTemplateUrl"></header>
2222
<header ng-if="!headerTemplateUrl" header title="{{title}}"></header>
2323

24+
<div class="side-nav--meta side-nav--meta--top invisible-lg">
25+
<div class="row row--sm">
26+
<div class="col">
27+
<small><em>Browsing Version</em></small>
28+
29+
<select
30+
ng-model="versionSelected"
31+
ng-options="version for version in versions"
32+
ng-change="loadDocsVersion(versionSelected)"></select>
33+
</div>
34+
<div ng-if="lastBuiltDate" class="col--right">
35+
<small><em>Last built {{lastBuiltDate.format('M/D/YY')}}.</em></small>
36+
</div>
37+
</div>
38+
</div>
39+
2440
<section class="content" ng-transclude></section>
2541

2642
<nav class="side-nav">
27-
<div class="side-nav--meta">
43+
<div class="side-nav--meta visible-lg">
2844
<small><em>Browsing Version</em></small>
2945

3046
<select
@@ -33,7 +49,7 @@ <h1 class="logo">
3349
ng-change="loadDocsVersion(versionSelected)"></select>
3450

3551
<div ng-if="lastBuiltDate">
36-
<small><em>Docs last built {{lastBuiltDate}}.</em></small>
52+
<small><em>Docs last built {{lastBuiltDate.format('MMMM Do, YYYY')}}.</em></small>
3753
</div>
3854
</div>
3955

docs/site/css/main.css

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,34 @@ ul {
187187
float: none;
188188
}
189189

190+
@media only screen and (min-width: 19em) {
191+
.row--sm .row--right {
192+
float: right;
193+
}
194+
195+
.row--sm [class*='col'] {
196+
float: left;
197+
}
198+
199+
.row--sm .col--right {
200+
float: right;
201+
}
202+
203+
.row--sm .col-10 { width: 10%; }
204+
.row--sm .col-20 { width: 20%; }
205+
.row--sm .col-25 { width: 25%; }
206+
.row--sm .col-30 { width: 30%; }
207+
.row--sm .col-33 { width: 33%; }
208+
.row--sm .col-40 { width: 40%; }
209+
.row--sm .col-50 { width: 50%; }
210+
.row--sm .col-60 { width: 60%; }
211+
.row--sm .col-66 { width: 66%; }
212+
.row--sm .col-70 { width: 70%; }
213+
.row--sm .col-75 { width: 75%; }
214+
.row--sm .col-80 { width: 80%; }
215+
.row--sm .col-90 { width: 90%; }
216+
}
217+
190218
@media only screen and (min-width: 45em) {
191219
.row--right {
192220
float: right;
@@ -196,6 +224,10 @@ ul {
196224
float: left;
197225
}
198226

227+
.col--right {
228+
float: right;
229+
}
230+
199231
.col-10 { width: 10%; }
200232
.col-20 { width: 20%; }
201233
.col-25 { width: 25%; }
@@ -994,17 +1026,22 @@ ul {
9941026
Side Nav
9951027
*/
9961028

997-
.side-nav {
1029+
.side-nav {
9981030
padding-bottom: 3em;
9991031
background: #efefef;
1000-
}
1032+
}
10011033

1002-
.side-nav .side-nav--meta {
1034+
.side-nav--meta {
10031035
padding: 10px;
10041036
background-color: #f5f5f5;
10051037
text-align: center;
10061038
margin-bottom: 10px;
1007-
}
1039+
}
1040+
1041+
.side-nav--meta--top {
1042+
padding-left: 2em;
1043+
padding-right: 2em;
1044+
}
10081045

10091046
.side-nav a {
10101047
display: block;
@@ -1159,6 +1196,10 @@ ul {
11591196
*zoom: 1;
11601197
}
11611198

1199+
.visible-lg {
1200+
display: none;
1201+
}
1202+
11621203
/* ==========================================================================
11631204
EXAMPLE Media Queries for Responsive Design.
11641205
These examples override the primary ('mobile first') styles.
@@ -1366,6 +1407,12 @@ ul {
13661407
}
13671408

13681409
@media only screen and (min-width: 60em) {
1410+
.visible-lg {
1411+
display: block;
1412+
}
1413+
.invisible-lg {
1414+
display: none !important;
1415+
}
13691416

13701417
/*
13711418
Content

0 commit comments

Comments
 (0)