Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
University of Michigan Fencing
club-theme
Commits
b54a6903
Commit
b54a6903
authored
May 05, 2016
by
key-amb
Browse files
Improve: fix sidebar position for single page
parent
540f27bf
Changes
4
Hide whitespace changes
Inline
Side-by-side
layouts/partials/footer.html
View file @
b54a6903
...
...
@@ -30,6 +30,7 @@
<script
src=
"{{ $baseUrl }}/js/highlight.pack.js"
></script>
<script>
hljs
.
initHighlightingOnLoad
();
</script>
<script
src=
"{{ $baseUrl }}/js/ie10-viewport-bug-workaround.js"
></script>
<script
src=
"{{ $baseUrl }}/js/bootie-docs.js"
></script>
</body>
</html>
layouts/partials/sidebar-single.html
View file @
b54a6903
{{ $baseUrl := .Site.BaseURL }}
<div
class=
"col-sm-3 col-sm-offset-1 doc-sidebar"
>
<div
id=
"sidebar"
>
<div
class=
"sidebar-module"
>
<div
class=
"sidebar-toc"
>
<h4>
Table of Contents
</h4>
...
...
@@ -17,4 +18,5 @@
{{ end }}
</div>
</div>
</div>
</div>
<!-- /.doc-sidebar -->
\ No newline at end of file
static/css/bootie-docs.css
View file @
b54a6903
...
...
@@ -68,6 +68,14 @@ h2, .h2 {
font-size
:
80%
;
}
/*
* Sidebar
*/
div
#sidebar
{
position
:
fixed
;
}
/* Sidebar modules for boxing content */
.sidebar-module
{
padding
:
15px
;
...
...
static/js/bootie-docs.js
0 → 100644
View file @
b54a6903
window
.
onload
=
function
()
{
var
headHeight
=
$
(
"
nav
"
).
height
();
var
mainHeight
=
$
(
"
main
"
).
height
();
var
sideHeight
=
$
(
"
#sidebar
"
).
height
();
var
footHeight
=
$
(
"
footer
"
).
height
();
var
totalHeight
=
headHeight
+
mainHeight
+
footHeight
;
var
w
=
$
(
window
);
if
(
sideHeight
>
0
&&
sideHeight
<
mainHeight
)
{
$
(
"
.doc-sidebar
"
).
css
(
"
height
"
,
mainHeight
);
var
sideNode
=
$
(
"
#sidebar
"
);
var
scrollStart
=
0
;
var
scrollStop
=
headHeight
+
mainHeight
-
sideHeight
;
w
.
scroll
(
function
()
{
if
(
w
.
scrollTop
()
<=
scrollStart
)
{
sideNode
.
css
({
"
position
"
:
"
fixed
"
});
}
else
if
(
scrollStart
<
w
.
scrollTop
()
&&
w
.
scrollTop
()
<
scrollStop
)
{
sideNode
.
css
({
"
position
"
:
"
fixed
"
,
"
top
"
:
headHeight
+
"
px
"
});
}
else
if
(
w
.
scrollTop
()
>=
scrollStop
)
{
var
topNext
=
headHeight
-
(
headHeight
+
sideHeight
)
*
(
w
.
scrollTop
()
-
scrollStop
)
/
(
totalHeight
-
scrollStop
);
sideNode
.
css
({
"
position
"
:
"
fixed
"
,
"
top
"
:
topNext
+
"
px
"
,
"
bottom
"
:
footHeight
+
"
px
"
});
}
});
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment