Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
user-manual
manual-build
Commits
cf670c41
Commit
cf670c41
authored
Jul 12, 2019
by
Liam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added js to allow sidebar links to jump to a anchor without being hidden my the header
parent
9085a5c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
source/mahara/layout.html
source/mahara/layout.html
+24
-0
No files found.
source/mahara/layout.html
View file @
cf670c41
...
...
@@ -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