Prevent last swimlane to be hidden if there is only one

Fixes #4376
This commit is contained in:
Psy-Q
2020-05-07 06:46:01 +02:00
committed by GitHub
parent 17b764e862
commit 21f563fdd5
2 changed files with 16 additions and 2 deletions

View File

@@ -6,6 +6,10 @@ Kanboard.Swimlane.prototype.execute = function() {
if ($(".swimlanes-table").length) {
this.dragAndDrop();
}
if ($("#board").length) {
this.expandSingleSwimlane();
}
};
Kanboard.Swimlane.prototype.listen = function() {
@@ -126,3 +130,11 @@ Kanboard.Swimlane.prototype.savePosition = function(swimlaneId, position) {
}
});
};
// Prevents swimlane from becoming invisible/unusable when all swimlanes
// except for one have been removed.
Kanboard.Swimlane.prototype.expandSingleSwimlane = function() {
if ($("tr.board-swimlane").length == 1) {
localStorage.clear(this.getStorageKey());
}
}