Add link to toggle column scrolling in board view

This commit is contained in:
Patrick Yates
2020-10-05 07:57:34 +11:00
committed by GitHub
parent ee842bf509
commit 8322876d8e
40 changed files with 170 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -113,9 +113,12 @@ a.board-swimlane-toggle:focus {
}
.board-task-list {
min-height: 60px
}
.board-task-list-compact {
max-height: 90vh;
overflow-y: auto;
min-height: 60px
}
.board-task-list .task-board:last-child {

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,53 @@
Kanboard.BoardVerticalScrolling = function(app) {
this.app = app;
};
Kanboard.BoardVerticalScrolling.prototype.execute = function() {
if (this.app.hasId("board")) {
this.render();
}
};
Kanboard.BoardVerticalScrolling.prototype.listen = function() {
var self = this;
$(document).on('click', ".filter-vert-toggle-collapse", function(e) {
e.preventDefault();
self.toggle();
});
};
Kanboard.BoardVerticalScrolling.prototype.onBoardRendered = function() {
this.render();
};
Kanboard.BoardVerticalScrolling.prototype.toggle = function() {
var self = this;
var scrolling = localStorage.getItem("vertical_scroll") || 1;
localStorage.setItem("vertical_scroll", scrolling == 0 ? 1 : 0);
var task_lists = $(".board-task-list");
task_lists.each(function() {
// clear min-height so that it can be properly recalculated
$(this).css("min-height", "");
});
this.render();
// set up drag and drop again (resets min-height)
self.app.get("BoardDragAndDrop").dragAndDrop();
};
Kanboard.BoardVerticalScrolling.prototype.render = function() {
if (localStorage.getItem("vertical_scroll") == 0) {
$(".filter-vert-expand").show();
$(".filter-vert-collapse").hide();
$("#board td .board-task-list").addClass("board-task-list-compact");
}
else {
$(".filter-vert-expand").hide();
$(".filter-vert-collapse").show();
$("#board td .board-task-list").removeClass("board-task-list-compact");
}
};