mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
28 lines
568 B
JavaScript
28 lines
568 B
JavaScript
const cls = require("./cls");
|
|
const becca = require("../becca/becca");
|
|
|
|
function getHoistedNoteId() {
|
|
return cls.getHoistedNoteId();
|
|
}
|
|
|
|
function isHoistedInHiddenSubtree() {
|
|
const hoistedNoteId = getHoistedNoteId();
|
|
|
|
if (hoistedNoteId === 'root') {
|
|
return false;
|
|
}
|
|
|
|
const hoistedNote = becca.getNote(hoistedNoteId);
|
|
|
|
if (!hoistedNote) {
|
|
throw new Error(`Cannot find hoisted note ${hoistedNoteId}`);
|
|
}
|
|
|
|
return hoistedNote.hasAncestor('hidden');
|
|
}
|
|
|
|
module.exports = {
|
|
getHoistedNoteId,
|
|
isHoistedInHiddenSubtree
|
|
};
|