summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Vorobyev <vorobyev@coacha.com>2017-02-23 21:47:25 +0900
committerKonstantin Vorobyev <vorobyev@coacha.com>2017-02-23 21:47:25 +0900
commit8b8ccf4a604f010fd4fadd53161e307959c5fb58 (patch)
tree5f7d1c1b23a63b60b4cd505b7399120281eef28c
parent3d7a682ec794b7485fc979ca910e22c6438a3c26 (diff)
Properly resize task list height on column toggle #3069
-rw-r--r--assets/js/src/BoardColumnView.js1
-rw-r--r--assets/js/src/BoardDragAndDrop.js12
2 files changed, 9 insertions, 4 deletions
diff --git a/assets/js/src/BoardColumnView.js b/assets/js/src/BoardColumnView.js
index 2da1bdfa..b523f44a 100644
--- a/assets/js/src/BoardColumnView.js
+++ b/assets/js/src/BoardColumnView.js
@@ -38,6 +38,7 @@ Kanboard.BoardColumnView.prototype.toggle = function(columnId) {
else {
this.hideColumn(columnId);
}
+ this.app.get("BoardDragAndDrop").dragAndDrop();
};
Kanboard.BoardColumnView.prototype.hideColumn = function(columnId) {
diff --git a/assets/js/src/BoardDragAndDrop.js b/assets/js/src/BoardDragAndDrop.js
index 5d2844de..67f287ad 100644
--- a/assets/js/src/BoardDragAndDrop.js
+++ b/assets/js/src/BoardDragAndDrop.js
@@ -5,8 +5,8 @@ Kanboard.BoardDragAndDrop = function(app) {
Kanboard.BoardDragAndDrop.prototype.execute = function() {
if (this.app.hasId("board")) {
- this.dragAndDrop();
this.executeListeners();
+ this.dragAndDrop();
}
};
@@ -48,9 +48,13 @@ Kanboard.BoardDragAndDrop.prototype.dragAndDrop = function() {
params.handle = ".task-board-sort-handle";
}
- // Set dropzone height to the height of the table cell
+ // Set visible dropzone height to the height of the table cell
dropzone.each(function() {
- $(this).css("min-height", $(this).parent().height());
+ if ($(this).filter(':visible').length) { // This drop zone is visible
+ $(this).css("min-height", $(this).parent().height());
+ } else { // Remove min-height
+ $(this).css("min-height", '');
+ }
});
dropzone.sortable(params);
@@ -101,8 +105,8 @@ Kanboard.BoardDragAndDrop.prototype.refresh = function(data) {
$("#board-container").replaceWith(data);
this.app.hideLoadingIcon();
- this.dragAndDrop();
this.executeListeners();
+ this.dragAndDrop();
};
Kanboard.BoardDragAndDrop.prototype.executeListeners = function() {