1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-20 23:30:05 +02:00

Revert "All: Added support for hierarchical/nested tags (#2572)"

This reverts commit e11e57f1d8.
This commit is contained in:
Laurent Cozic
2020-07-28 18:50:34 +01:00
parent 89e6b680a6
commit 64d7603eed
31 changed files with 191 additions and 991 deletions

View File

@@ -4,7 +4,6 @@ const Note = require('lib/models/Note.js');
const { Database } = require('lib/database.js');
const { _ } = require('lib/locale.js');
const BaseItem = require('lib/models/BaseItem.js');
const { nestedPath } = require('lib/nested-utils.js');
const { substrWithEllipsis } = require('lib/string-utils.js');
class Folder extends BaseItem {
@@ -264,7 +263,22 @@ class Folder extends BaseItem {
}
static folderPath(folders, folderId) {
return nestedPath(folders, folderId);
const idToFolders = {};
for (let i = 0; i < folders.length; i++) {
idToFolders[folders[i].id] = folders[i];
}
const path = [];
while (folderId) {
const folder = idToFolders[folderId];
if (!folder) break; // Shouldn't happen
path.push(folder);
folderId = folder.parent_id;
}
path.reverse();
return path;
}
static folderPathString(folders, folderId, maxTotalLength = 80) {