Removed individual column scrolling on board
This commit is contained in:
parent
9d6715ddc0
commit
5d3ad534cc
|
|
@ -15,6 +15,7 @@ New features:
|
|||
|
||||
Improvements:
|
||||
|
||||
* Removed individual column scrolling on board, columns use the height of all tasks
|
||||
* Improve project page title
|
||||
* Remove sidebar titles when not necessary
|
||||
* Internal events management refactoring
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@
|
|||
<td class="
|
||||
board-column-<?= $column['id'] ?>
|
||||
<?= $column['task_limit'] > 0 && $column['nb_tasks'] > $column['task_limit'] ? 'board-task-list-limit' : '' ?>
|
||||
">
|
||||
"
|
||||
>
|
||||
|
||||
<!-- tasks list -->
|
||||
<div class="board-task-list board-column-expanded" data-column-id="<?= $column['id'] ?>" data-swimlane-id="<?= $swimlane['id'] ?>" data-task-limit="<?= $column['task_limit'] ?>">
|
||||
|
|
|
|||
|
|
@ -20,14 +20,6 @@
|
|||
<i class="fa fa-arrows-h fa-fw"></i> <a href="#" class="filter-toggle-scrolling" title="<?= t('Keyboard shortcut: "%s"', 'c') ?>"><?= t('Horizontal scrolling') ?></a>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class="filter-max-height" style="display: none">
|
||||
<i class="fa fa-arrows-v fa-fw"></i> <a href="#" class="filter-toggle-height"><?= t('Set maximum column height') ?></a>
|
||||
</span>
|
||||
<span class="filter-min-height">
|
||||
<i class="fa fa-arrows-v fa-fw"></i> <a href="#" class="filter-toggle-height"><?= t('Remove maximum column height') ?></a>
|
||||
</span>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($this->user->hasProjectAccess('TaskCreationController', 'show', $project['id'])): ?>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -126,7 +126,6 @@ a.board-swimlane-toggle:focus {
|
|||
|
||||
/* board task list */
|
||||
.board-task-list {
|
||||
overflow: auto;
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue