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
user-manual
manual-build
Commits
0a98599b
Commit
0a98599b
authored
Jul 13, 2019
by
Kristina Hoeppner
Browse files
Added js to allow sidebar links to jump to an anchor without being hidden by the header
See merge request
!4
parents
9085a5c4
cf670c41
Changes
1
Hide whitespace changes
Inline
Side-by-side
source/mahara/layout.html
View file @
0a98599b
...
...
@@ -249,6 +249,30 @@
<noscript><p><img
src=
"//www.catalyst-analytics.nz/piwik.php?idsite=5"
style=
"border:0;"
alt=
""
/></p></noscript>
<!-- End Piwik Code -->
<script
type=
"text/javascript"
>
/**
* Offset html anchors for fixed header
*/
jQuery
(
function
(
$
)
{
$
(
document
).
on
(
'
click
'
,
'
a
'
,
function
(
event
)
{
if
(
$
(
this
.
hash
).
length
&&
location
.
pathname
.
replace
(
/^
\/
/
,
''
)
==
this
.
pathname
.
replace
(
/^
\/
/
,
''
))
{
event
.
preventDefault
();
var
target
=
$
(
this
.
hash
);
var
headerheight
=
0
;
if
(
$
(
'
#navbar-top
'
).
length
)
{
headerheight
=
$
(
'
#navbar-top
'
).
height
();
}
else
if
(
$
(
'
.container-fluid
'
).
length
)
{
headerheight
=
$
(
'
.container-fluid
'
).
offset
().
top
;
}
$
(
'
html, body
'
).
animate
({
scrollTop
:
(
target
.
offset
().
top
-
(
headerheight
*
2
))
},
500
);
}
});
});
</script>
{% endblock %}
</head>
<body
role=
"document"
>
...
...
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