diff options
author | Frédéric Guillot <contact@fredericguillot.com> | 2014-02-25 22:09:44 -0500 |
---|---|---|
committer | Frédéric Guillot <contact@fredericguillot.com> | 2014-02-25 22:09:44 -0500 |
commit | 44b18060834b0afad7c875d32ea162c9f6e31621 (patch) | |
tree | f0e4f726fffc7a2c36f387083f6c9c7958386164 /assets | |
parent | 44fc9c081fb7561b7b02115f9b2a6eb0349d2201 (diff) |
Add task limit for each column
Diffstat (limited to 'assets')
-rw-r--r-- | assets/css/app.css | 4 | ||||
-rw-r--r-- | assets/js/board.js | 17 |
2 files changed, 21 insertions, 0 deletions
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({ |