You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-08-13 22:12:50 +02:00
All: Allow longer folder paths
This commit is contained in:
@@ -236,12 +236,24 @@ class Folder extends BaseItem {
|
||||
return path;
|
||||
}
|
||||
|
||||
static folderPathString(folders, folderId) {
|
||||
static folderPathString(folders, folderId, maxTotalLength = 80) {
|
||||
const path = this.folderPath(folders, folderId);
|
||||
|
||||
let currentTotalLength = 0;
|
||||
for (let i = 0; i < path.length; i++) {
|
||||
currentTotalLength += path[i].title.length;
|
||||
}
|
||||
|
||||
let pieceLength = maxTotalLength;
|
||||
if (currentTotalLength > maxTotalLength) {
|
||||
pieceLength = maxTotalLength / path.length;
|
||||
}
|
||||
|
||||
const output = [];
|
||||
for (let i = 0; i < path.length; i++) {
|
||||
output.push(substrWithEllipsis(path[i].title, 0, 16));
|
||||
output.push(substrWithEllipsis(path[i].title, 0, pieceLength));
|
||||
}
|
||||
|
||||
return output.join(' / ');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user