this is easier on the eyes when collapsing a long post/comment

This commit is contained in:
Mario Vavti 2015-04-08 08:53:28 +02:00
parent b212482330
commit 549bcf5a72

View File

@ -620,13 +620,14 @@ function collapseHeight() {
if(orgHeight > divmore_height + 10) {
if(! $(this).hasClass('divmore')) {
$(this).readmore({
speed: 0,
collapsedHeight: divmore_height,
moreLink: '<a href="#" class="divgrow-showmore">' + aStr.divgrowmore + '</a>',
lessLink: '<a href="#" class="divgrow-showmore">' + aStr.divgrowless + '</a>',
beforeToggle: function(trigger, element, expanded) {
if(expanded) {
if((($(element).offset().top + divmore_height) - $(window).scrollTop()) < 65 ) {
$('html, body').animate( { scrollTop: $(window).scrollTop() - (orgHeight - divmore_height) }, {duration: 100 } );
$('html, body').animate( { scrollTop: $(window).scrollTop() - (orgHeight - divmore_height) }, {duration: 0 } );
}
}
}