blob: 3fc5883ea6001051e57c9fb7619ca6b4f78d3cd3 [file] [log] [blame]
$(document).ready(function() {
var txt_show = 'Show more packages ↓';
var txt_close = 'Hide more packages ↑'
function get_featuredRowsHeight(){
var sum = 0;
$('div.row:lt(6)').each(function() {
sum += $(this).outerHeight(true);
});
return sum;
}
var fullDownloadHeight = $('.featuredRows').height();
var featuredRowsHeight = get_featuredRowsHeight();
$('.featuredRows').height(featuredRowsHeight);
$('.featuredRows').after('<a href="#" id="btn-toogle-downloads" class="action-button">' + txt_show + '</a>');
$("#btn-toogle-downloads").toggle(function() {
$('.featuredRows').animate({height:fullDownloadHeight}, 'slow').attr('id', 'topbar-hide');
$(this).html(txt_close).text();
}, function() {
$('.featuredRows').animate({height:featuredRowsHeight}, 'slow').attr('id', 'topbar-hide');
$(this).html(txt_show).text();
});
});