Add back to top buttons.

This commit is contained in:
Rob 2016-08-23 18:12:44 -07:00
parent b550aae76a
commit 5c6fb20d7f
2 changed files with 11 additions and 1 deletions

View file

@ -14,6 +14,11 @@
color: #fff
text-decoration: none
.back-to-top
text-transform: none
@media print
display: none
.lesson-plans
max-width: 900px
background-color: #f8f8f8

View file

@ -8,6 +8,11 @@ module.exports = class MarkdownResourceView extends RootView
@content = ''
$.get '/markdown/' + @name + '.md', (data) =>
if data.indexOf('<!doctype html>') is -1
@content = marked(data, sanitize: false)
i = 0
@content = marked(data, sanitize: false).replace /<\/h5/g, () ->
if i++ == 0
'</h5'
else
'<a class="pull-right btn btn-md btn-navy back-to-top" href="#logo-img">Back to top</a></h5'
@render()