summaryrefslogtreecommitdiff
path: root/assets/js/src
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-07-24 15:18:09 -0400
committerFrederic Guillot <fred@kanboard.net>2016-07-24 15:18:09 -0400
commit5d3ad534ccd386ba2e995de7c26a00d63bbd50dc (patch)
treea20fefc6fe38f72595f82d7ec313ac7ba810f5d5 /assets/js/src
parent9d6715ddc01586e524ef433732d649e17f1d88b5 (diff)
Removed individual column scrolling on board
Diffstat (limited to 'assets/js/src')
-rw-r--r--assets/js/src/BoardColumnScrolling.js85
-rw-r--r--assets/js/src/BoardDragAndDrop.js8
2 files changed, 7 insertions, 86 deletions
diff --git a/assets/js/src/BoardColumnScrolling.js b/assets/js/src/BoardColumnScrolling.js
deleted file mode 100644
index e637180d..00000000
--- a/assets/js/src/BoardColumnScrolling.js
+++ /dev/null
@@ -1,85 +0,0 @@
-Kanboard.BoardColumnScrolling = function(app) {
- this.app = app;
-};
-
-Kanboard.BoardColumnScrolling.prototype.execute = function() {
- if (this.app.hasId("board")) {
- this.render();
-
- $(window).on("load", this.render);
- $(window).resize(this.render);
- }
-};
-
-Kanboard.BoardColumnScrolling.prototype.listen = function() {
- var self = this;
-
- $(document).on('click', ".filter-toggle-height", function(e) {
- e.preventDefault();
- self.toggle();
- });
-};
-
-Kanboard.BoardColumnScrolling.prototype.onBoardRendered = function() {
- this.render();
-};
-
-Kanboard.BoardColumnScrolling.prototype.toggle = function() {
- var scrolling = localStorage.getItem("column_scroll");
-
- if (scrolling == undefined) {
- scrolling = 1;
- }
-
- localStorage.setItem("column_scroll", scrolling == 0 ? 1 : 0);
- this.render();
-};
-
-Kanboard.BoardColumnScrolling.prototype.render = function() {
- var taskList = $(".board-task-list");
- var rotationWrapper = $(".board-rotation-wrapper");
- var filterMax = $(".filter-max-height");
- var filterMin = $(".filter-min-height");
-
- if (localStorage.getItem("column_scroll") == 0) {
- var height = 80;
-
- filterMax.show();
- filterMin.hide();
- rotationWrapper.css("min-height", '');
-
- taskList.each(function() {
- var columnHeight = $(this).height();
-
- if (columnHeight > height) {
- height = columnHeight;
- }
- });
-
- taskList.css("min-height", height);
- taskList.css("height", '');
- }
- else {
-
- filterMax.hide();
- filterMin.show();
-
- if ($(".board-swimlane").length > 1) {
- taskList.each(function() {
- if ($(this).height() > 500) {
- $(this).css("height", 500);
- }
- else {
- $(this).css("min-height", 320); // Height of the dropdown menu
- rotationWrapper.css("min-height", 320);
- }
- });
- }
- else {
- var height = $(window).height() - 170;
-
- taskList.css("height", height);
- rotationWrapper.css("min-height", height);
- }
- }
-};
diff --git a/assets/js/src/BoardDragAndDrop.js b/assets/js/src/BoardDragAndDrop.js
index 4d2ae3ec..c8e24444 100644
--- a/assets/js/src/BoardDragAndDrop.js
+++ b/assets/js/src/BoardDragAndDrop.js
@@ -12,6 +12,7 @@ Kanboard.BoardDragAndDrop.prototype.execute = function() {
Kanboard.BoardDragAndDrop.prototype.dragAndDrop = function() {
var self = this;
+ var dropzone = $(".board-task-list");
var params = {
forcePlaceholderSize: true,
tolerance: "pointer",
@@ -47,7 +48,12 @@ Kanboard.BoardDragAndDrop.prototype.dragAndDrop = function() {
params["handle"] = ".task-board-sort-handle";
}
- $(".board-task-list").sortable(params);
+ // Set dropzone height to the height of the table cell
+ dropzone.each(function() {
+ $(this).css("min-height", $(this).parent().height());
+ });
+
+ dropzone.sortable(params);
};
Kanboard.BoardDragAndDrop.prototype.changeTaskState = function(taskId) {