diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-07-20 05:39:08 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-07-20 05:39:08 -0400 |
commit | e0d9d30bcf3b3b8f08bebc3ea6a8bbd20416f272 (patch) | |
tree | 27bd2e18dddc900edc39f34b47bfea749b3dcf61 /view/tpl/cover_photo_widget.tpl | |
parent | 50e581d88ad4901b13bbf99b2e58a5787b6bccec (diff) | |
parent | 9421e42dad0bee6e0aa292d390cf249e1d7f7df4 (diff) | |
download | volse-hubzilla-e0d9d30bcf3b3b8f08bebc3ea6a8bbd20416f272.tar.gz volse-hubzilla-e0d9d30bcf3b3b8f08bebc3ea6a8bbd20416f272.tar.bz2 volse-hubzilla-e0d9d30bcf3b3b8f08bebc3ea6a8bbd20416f272.zip |
Merge remote-tracking branch 'upstream/dev' into wiki
Diffstat (limited to 'view/tpl/cover_photo_widget.tpl')
-rwxr-xr-x | view/tpl/cover_photo_widget.tpl | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/view/tpl/cover_photo_widget.tpl b/view/tpl/cover_photo_widget.tpl index 8254fc87d..4e210a300 100755 --- a/view/tpl/cover_photo_widget.tpl +++ b/view/tpl/cover_photo_widget.tpl @@ -1,8 +1,17 @@ <script> + var aside_padding_top; + var section_padding_top; + $(document).ready(function() { + + aside_padding_top = parseInt($('aside').css('padding-top')); + section_padding_top = parseInt($('section').css('padding-top')); + if($('#cover-photo').length && $(window).width() > 755) { $('.navbar-fixed-top').css('position', 'relative'); - $('aside, section').css('padding-top', 0 + 'px'); + $('main').css('margin-top', - $('nav').outerHeight(true) + 'px'); + $('aside').css('padding-top', aside_padding_top - $('nav').outerHeight() + 'px'); + $('section').css('padding-top', section_padding_top - $('nav').outerHeight() + 'px'); $('main').css('opacity', 0); $('header').hide(); } @@ -15,9 +24,11 @@ if($('#cover-photo').length && $(window).width() > 755 && $(window).scrollTop() >= $('#cover-photo').height()) { $('header').fadeIn(); $('main').css('opacity', 1); - $('aside, section').css('padding-top', $('nav').outerHeight(true) + 'px'); + $('aside').css('padding-top', aside_padding_top + 'px'); + $('section').css('padding-top', section_padding_top + 'px'); $(window).scrollTop($(window).scrollTop() - $('#cover-photo').height()) $('.navbar-fixed-top').css('position', 'fixed'); + $('main').css('margin-top', ''); $('#cover-photo').remove(); } if($('#cover-photo').length) { @@ -28,7 +39,8 @@ $(window).resize(function () { if($('#cover-photo').length && $(window).width() < 755) { $('main').css('opacity', 1); - $('aside, section').css('padding-top', $('nav').outerHeight(true) + 'px'); + $('aside').css('padding-top', aside_padding_top + 'px'); + $('section').css('padding-top', section_padding_top + 'px'); $('.navbar-fixed-top').css('position', 'fixed'); $('#cover-photo').remove(); } @@ -36,7 +48,7 @@ }); function slideUpCover() { - $('html, body').animate({scrollTop: $('#cover-photo').height() + 'px'}); + $('html, body').animate({scrollTop: Math.ceil($('#cover-photo').height()) + 'px' }); } </script> |