* Task #47358, support for setting kanban lane height with option "displayCards".

This commit is contained in:
Hao Sun
2022-01-13 13:10:15 +08:00
parent 9451a6b9f5
commit fa29706187
4 changed files with 24 additions and 6 deletions
+2 -1
View File
@@ -58,8 +58,9 @@
.region .kanban-lane-items {overflow: auto; padding-bottom: 10px;}
.region .kanban-item {position: relative}
.region .kanban-item > .kanban-card > .title {line-height: 18px;}
.region .kanban-item > .kanban-card > .title:hover {color: #2272eb}
.region .kanban-item > .kanban-card > .info {margin-top: 5px; position: relative;}
.region .kanban-item > .kanban-card > .info {margin-top: 4px; position: relative;}
.region .kanban-item > .kanban-card > .info > .pri {height: 14px; border-width: 1px; font-size: 12px; line-height: 12px; min-width: 14px; padding: 0 1px;}
.region .kanban-item > .kanban-card > .info > .estimate{margin-left: 4px; color: #999; background-color: rgb(255, 255, 255); padding: 3px 0px}
.region .kanban-item > .kanban-card > .info > .time {margin-left: 4px; font-size: 12px; background: rgb(242, 242, 242)}
+17
View File
@@ -762,6 +762,18 @@ function createColumnMenu(options)
return items;
}
/** Calculate column height */
function calcColHeight(col, lane, colCards, colHeight, kanban)
{
if(!isMultiLanes) return 0;
var options = kanban.options;
var displayCards = +(options.displayCards || 2);
if (typeof displayCards !== 'number' || displayCards < 2) displayCards = 2;
return (displayCards * (options.cardHeight + options.cardSpace) + options.cardSpace);
}
/* Define menu creators */
window.menuCreators =
{
@@ -782,9 +794,12 @@ function initKanban($kanban)
{
data: region.groups,
maxColHeight: 510,
calcColHeight: calcColHeight,
fluidBoardWidth: false,
minColWidth: 300,
maxColWidth: 300,
cardHeight: 60,
displayCards: window.displayCards || 2,
createColumnText: kanbanLang.createColumn,
addItemText: '',
itemRender: renderKanbanItem,
@@ -815,6 +830,8 @@ $(function()
{
if($.cookie('isFullScreen') == 1) fullScreen();
window.isMultiLanes = $('#kanban .kanban').length > 1 || $('#kanban .kanban-lane').length > 1;
/* Init first kanban */
$('.kanban').each(function()
{
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long