Add link to toggle column scrolling in board view
This commit is contained in:
2
assets/css/app.min.css
vendored
2
assets/css/app.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -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 {
|
||||
|
||||
2
assets/js/app.min.js
vendored
2
assets/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
53
assets/js/src/BoardVerticalScrolling.js
Normal file
53
assets/js/src/BoardVerticalScrolling.js
Normal 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");
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user