* task #7131, task #7132, task #7133, add cards view for program index page.

This commit is contained in:
Catouse
2020-05-08 11:37:28 +08:00
parent b55e3730f5
commit 326d45d0c5
12 changed files with 133 additions and 44 deletions
+27
View File
@@ -4,6 +4,33 @@ $(function()
{
var mine = $(this).is(':checked') ? 1 : 0;
$.cookie('mine', mine, {expires:config.cookieLife, path:config.webRoot});
window.location.reload();
});
// Auto resize cards size
var minCardWidth = 280;
var $cards = $('#cards');
var resizeCards = function()
{
var cardsWidth = $cards.width();
var bestColsSize = 1;
while((cardsWidth / (bestColsSize + 1)) > minCardWidth)
{
bestColsSize++;
}
console.log('bestColsSize', bestColsSize);
$cards.children('.col').css('width', (100 / bestColsSize) + '%');
};
resizeCards();
$(window).on('resize', resizeCards);
// Make cards clickable
$cards.on('click', '.panel', function(e)
{
if(!$(e.target).closest('.panel-actions').length)
{
window.location.href = $(this).data('url');
}
})
$('#programTableList').on('sort.sortable', function(e, data)