aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl/cover_photo_widget.tpl
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-07-15 13:20:00 +0200
committerMario Vavti <mario@mariovavti.com>2016-07-15 13:20:00 +0200
commit2e32b5f467e9bb66e339c56308ad8a82163566e6 (patch)
treead03bdf26555b7136240917657a5e7a768529a3b /view/tpl/cover_photo_widget.tpl
parent7ee7f00bf34b11d0427f03df9494088cf56ef9ee (diff)
downloadvolse-hubzilla-2e32b5f467e9bb66e339c56308ad8a82163566e6.tar.gz
volse-hubzilla-2e32b5f467e9bb66e339c56308ad8a82163566e6.tar.bz2
volse-hubzilla-2e32b5f467e9bb66e339c56308ad8a82163566e6.zip
upgrade to jquery-3.1 and minor fixes
Diffstat (limited to 'view/tpl/cover_photo_widget.tpl')
-rwxr-xr-xview/tpl/cover_photo_widget.tpl20
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..5e97d3773 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: $('#cover-photo').height() + 1 + 'px' });
}
</script>