From 44b18060834b0afad7c875d32ea162c9f6e31621 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Tue, 25 Feb 2014 22:09:44 -0500 Subject: Add task limit for each column --- assets/css/app.css | 4 ++++ assets/js/board.js | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'assets') diff --git a/assets/css/app.css b/assets/css/app.css index 123ad305..14e77508 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -445,6 +445,10 @@ nav .active a { vertical-align: top; } +#board td.task-limit-warning { + background-color: red; +} + .task-title { margin-top: 10px; font-size: 110%; diff --git a/assets/js/board.js b/assets/js/board.js index a9bd35d1..4620b668 100644 --- a/assets/js/board.js +++ b/assets/js/board.js @@ -111,6 +111,23 @@ [].forEach.call(cols, function(col) { + var task_limit = col.getAttribute("data-task-limit"); + + if (task_limit != "") { + + task_limit = parseInt(task_limit); + + if (col.children.length > task_limit) { + col.classList.add("task-limit-warning"); + } + else { + col.classList.remove("task-limit-warning"); + } + + var counter = document.getElementById("task-number-column-" + col.getAttribute("data-column-id")); + if (counter) counter.innerHTML = col.children.length; + } + [].forEach.call(col.children, function(item) { data.push({ -- cgit v1.2.3