diff options
author | Mario Vavti <mario@mariovavti.com> | 2016-07-22 14:03:14 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2016-07-22 14:03:14 +0200 |
commit | 38e46fff548729ba459d0a83a46fbfa0d844e85d (patch) | |
tree | 488782af68f0e6709a037e697d7e373656143f6c /view/js | |
parent | 7d897a3f03bd57ed556433eb84a41963ba44e02e (diff) | |
download | volse-hubzilla-38e46fff548729ba459d0a83a46fbfa0d844e85d.tar.gz volse-hubzilla-38e46fff548729ba459d0a83a46fbfa0d844e85d.tar.bz2 volse-hubzilla-38e46fff548729ba459d0a83a46fbfa0d844e85d.zip |
upgrade readmore.js and improve collapsing a little
Diffstat (limited to 'view/js')
-rw-r--r-- | view/js/main.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/view/js/main.js b/view/js/main.js index a288f98f5..a3fade0ea 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -659,7 +659,7 @@ function collapseHeight() { var position = $(window).scrollTop(); $(".wall-item-content, .directory-collapse").each(function() { - var orgHeight = parseInt($(this).css('height')); + var orgHeight = $(this).outerHeight(true); if(orgHeight > divmore_height) { if(! $(this).hasClass('divmore')) { @@ -679,7 +679,7 @@ function collapseHeight() { beforeToggle: function(trigger, element, expanded) { if(expanded) { if((($(element).offset().top + divmore_height) - $(window).scrollTop()) < 65 ) { - $(window).scrollTop($(window).scrollTop() - (orgHeight - divmore_height)); + $(window).scrollTop($(window).scrollTop() - ($(element).outerHeight(true) - divmore_height)); } } } |