|
|
@@ -3,11 +3,13 @@
|
|
|
{% block html_title %}{{ path|path2name }} · {{ path }}{% endblock %}
|
|
|
|
|
|
{% block content_head %}
|
|
|
- <header data-spy="affix" data-offset-top="80" id="page-header">
|
|
|
+<div class="header-wrap">
|
|
|
+ <header id="page-header">
|
|
|
<p class="stopper"><a href="#" data-affix-disable="#page-header"><i class="fa fa-chevron-up"></i></a></p>
|
|
|
|
|
|
<h1 class="title" id="revision-path">{{ path }}</h1>
|
|
|
</header>
|
|
|
+</div>
|
|
|
{% endblock %}
|
|
|
|
|
|
{% block content_main %}
|
|
|
@@ -114,23 +116,21 @@
|
|
|
//return false;
|
|
|
});
|
|
|
|
|
|
- var topMargin = $('#page-header').outerHeight() + 20;
|
|
|
- $('#page-header').on('affixed.bs.affix', function(e) {
|
|
|
- $('.content-main').css({'padding-top': topMargin});
|
|
|
- });
|
|
|
- $('#page-header').on('affixed-top.bs.affix', function(e) {
|
|
|
- if (!$('.content-main').hasClass('on-edit')) {
|
|
|
- $('.content-main').css({'padding-top': 0});
|
|
|
+ //data-spy="affix" data-offset-top="80"
|
|
|
+ var headerHeight = $('#page-header').outerHeight(true);
|
|
|
+ console.log(headerHeight);
|
|
|
+ $('.header-wrap').css({height: headerHeight + 'px'});
|
|
|
+ $('#page-header').affix({
|
|
|
+ offset: {
|
|
|
+ top: function() {
|
|
|
+ return headerHeight + 74; // (54 header + 20 padding-top)
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
$('[data-affix-disable]').on('click', function(e) {
|
|
|
$elm = $($(this).data('affix-disable'));
|
|
|
- $elm.removeClass('affix')
|
|
|
- .addClass('affix-top')
|
|
|
- .removeAttr('data-spy');
|
|
|
- if (!$('.content-main').hasClass('on-edit')) {
|
|
|
- $('.content-main').css({'padding-top': 0});
|
|
|
- }
|
|
|
+ $(window).off('.affix');
|
|
|
+ $elm.removeData('affix').removeClass('affix affix-top affix-bottom');
|
|
|
return false;
|
|
|
});
|
|
|
});
|